use of org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl in project jbosstools-hibernate by jbosstools.
the class JpaConfiguration method initialize.
void initialize() {
EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = HibernateToolsPersistenceProvider.createEntityManagerFactoryBuilder(persistenceUnit, getProperties());
EntityManagerFactory entityManagerFactory = entityManagerFactoryBuilder.build();
sessionFactory = (SessionFactory) entityManagerFactory;
metadata = entityManagerFactoryBuilder.getMetadata();
getProperties().putAll(entityManagerFactory.getProperties());
}
use of org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl in project jbosstools-hibernate by jbosstools.
the class JPAConfiguration method getMetadata.
public Metadata getMetadata() {
if (metadata == null) {
EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = HibernateToolsPersistenceProvider.createEntityManagerFactoryBuilder(persistenceUnit, getProperties());
EntityManagerFactory entityManagerFactory = entityManagerFactoryBuilder.build();
metadata = entityManagerFactoryBuilder.getMetadata();
getProperties().putAll(entityManagerFactory.getProperties());
}
return metadata;
}
use of org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl in project jbosstools-hibernate by jbosstools.
the class JPAConfiguration method getMetadata.
public Metadata getMetadata() {
if (metadata == null) {
EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = HibernateToolsPersistenceProvider.createEntityManagerFactoryBuilder(persistenceUnit, getProperties());
EntityManagerFactory entityManagerFactory = entityManagerFactoryBuilder.build();
metadata = entityManagerFactoryBuilder.getMetadata();
getProperties().putAll(entityManagerFactory.getProperties());
}
return metadata;
}
use of org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl in project jbosstools-hibernate by jbosstools.
the class HibernateToolsPersistenceProviderTest method testCreateEntityManagerFactoryBuilder.
@Test
public void testCreateEntityManagerFactoryBuilder() {
Properties properties = new Properties();
properties.put("foo", "bar");
assertNull(HibernateToolsPersistenceProvider.createEntityManagerFactoryBuilder("barfoo", properties));
EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = HibernateToolsPersistenceProvider.createEntityManagerFactoryBuilder("foobar", properties);
assertNotNull(entityManagerFactoryBuilder);
assertEquals("bar", entityManagerFactoryBuilder.getConfigurationValues().get("foo"));
}
use of org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl in project jbosstools-hibernate by jbosstools.
the class JpaConfiguration method initialize.
void initialize() {
EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = HibernateToolsPersistenceProvider.createEntityManagerFactoryBuilder(persistenceUnit, getProperties());
EntityManagerFactory entityManagerFactory = entityManagerFactoryBuilder.build();
sessionFactory = (SessionFactory) entityManagerFactory;
metadata = entityManagerFactoryBuilder.getMetadata();
getProperties().putAll(entityManagerFactory.getProperties());
}
Aggregations