Search in sources :

Example 16 with ServiceRegistryBuilder

use of org.hibernate.service.ServiceRegistryBuilder in project jbosstools-hibernate by jbosstools.

the class SessionFactoryFacadeTest method testClose.

@Test
public void testClose() {
    Configuration configuration = new Configuration();
    SessionFactory sessionFactory = configuration.buildSessionFactory(new ServiceRegistryBuilder().buildServiceRegistry());
    sessionFactory.openSession();
    ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
    Assert.assertFalse(sessionFactory.isClosed());
    sessionFactoryFacade.close();
    Assert.assertTrue(sessionFactory.isClosed());
}
Also used : ISessionFactory(org.jboss.tools.hibernate.runtime.spi.ISessionFactory) SessionFactory(org.hibernate.SessionFactory) Configuration(org.hibernate.cfg.Configuration) ISessionFactory(org.jboss.tools.hibernate.runtime.spi.ISessionFactory) ServiceRegistryBuilder(org.hibernate.service.ServiceRegistryBuilder) Test(org.junit.Test)

Aggregations

ServiceRegistryBuilder (org.hibernate.service.ServiceRegistryBuilder)16 Configuration (org.hibernate.cfg.Configuration)13 ServiceRegistry (org.hibernate.service.ServiceRegistry)11 Test (org.junit.Test)9 SessionFactory (org.hibernate.SessionFactory)6 ISessionFactory (org.jboss.tools.hibernate.runtime.spi.ISessionFactory)6 SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)4 Column (org.hibernate.mapping.Column)4 RootClass (org.hibernate.mapping.RootClass)4 SimpleValue (org.hibernate.mapping.SimpleValue)4 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)4 Table (org.hibernate.mapping.Table)3 ArrayList (java.util.ArrayList)2 Mappings (org.hibernate.cfg.Mappings)2 EntityMetamodel (org.hibernate.tuple.entity.EntityMetamodel)2 IClassMetadata (org.jboss.tools.hibernate.runtime.spi.IClassMetadata)2 ICollectionMetadata (org.jboss.tools.hibernate.runtime.spi.ICollectionMetadata)2 IEntityMetamodel (org.jboss.tools.hibernate.runtime.spi.IEntityMetamodel)2 Properties (java.util.Properties)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1