本文整理汇总了Java中org.hibernate.jpa.boot.spi.Bootstrap类的典型用法代码示例。如果您正苦于以下问题:Java Bootstrap类的具体用法?Java Bootstrap怎么用?Java Bootstrap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Bootstrap类属于org.hibernate.jpa.boot.spi包,在下文中一共展示了Bootstrap类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEntityManagerFactoryBuilderOrNull
import org.hibernate.jpa.boot.spi.Bootstrap; //导入依赖的package包/类
@Override
@SuppressWarnings("rawtypes")
protected EntityManagerFactoryBuilder getEntityManagerFactoryBuilderOrNull(String persistenceUnitName,
Map properties, ClassLoader providedClassLoader) {
EntityManagerFactoryBuilder builder;
LOG.tracef("Attempting to obtain correct EntityManagerFactoryBuilder for persistenceUnitName : %s",
persistenceUnitName);
final Map integration = wrap(properties);
PersistenceUnitDescriptor persistenceUnit = getPersistenceXmlDescriptor(persistenceUnitName, properties,
providedClassLoader);
if (persistenceUnit == null) {
LOG.debug("Found no matching persistence units");
builder = null;
} else {
builder = Bootstrap.getEntityManagerFactoryBuilder(persistenceUnit, integration, providedClassLoader);
}
return builder;
}
示例2: createContainerEntityManagerFactory
import org.hibernate.jpa.boot.spi.Bootstrap; //导入依赖的package包/类
/**
* {@inheritDoc}
* <p/>
* Improved with transaction and data source swapping properties
*/
@SuppressWarnings("rawtypes")
@Override
public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) {
EntityManagerFactory emf;
LOG.tracef("Starting createContainerEntityManagerFactory : %s", info.getPersistenceUnitName());
PersistenceUnitDescriptor descriptor = getPersistenceUnitDescriptor(info);
emf = Bootstrap.getEntityManagerFactoryBuilder(descriptor, properties).build();
return emf;
}
示例3: generateSchema
import org.hibernate.jpa.boot.spi.Bootstrap; //导入依赖的package包/类
/**
* Generates schema from {@link PersistenceUnitInfo} instance
*/
@SuppressWarnings("rawtypes")
@Override
public void generateSchema(PersistenceUnitInfo info, Map map) {
LOG.tracef("Starting generateSchema : PUI.name=%s", info.getPersistenceUnitName());
PersistenceUnitDescriptor descriptor = getPersistenceUnitDescriptor(info);
final EntityManagerFactoryBuilder builder = Bootstrap.getEntityManagerFactoryBuilder(descriptor, map);
builder.generateSchema();
}
示例4: build
import org.hibernate.jpa.boot.spi.Bootstrap; //导入依赖的package包/类
private void build(List<Class> entities) {
// Add new entities if not exists
if (entities != null) {
MutablePersistenceUnitInfo mutablePersistenceUnitInfo = (MutablePersistenceUnitInfo) info;
for (Class entity : entities) {
mutablePersistenceUnitInfo.addManagedClassName(entity.getName());
}
}
entityManagerFactory = Bootstrap.getEntityManagerFactoryBuilder(info, properties).build();
}
示例5: TwoPhaseBootstrapImpl
import org.hibernate.jpa.boot.spi.Bootstrap; //导入依赖的package包/类
public TwoPhaseBootstrapImpl(final PersistenceUnitInfo info, final Map map) {
entityManagerFactoryBuilder =
Bootstrap.getEntityManagerFactoryBuilder(info, map);
}