Search in sources :

Example 71 with Configuration

use of org.hibernate.cfg.Configuration in project API by ca-cwds.

the class ReferralClientDaoIT method setup.

@Override
@Before
public void setup() {
    sessionFactory = new Configuration().configure().buildSessionFactory();
    sessionFactory.getCurrentSession().beginTransaction();
    referralClientDao = new ReferralClientDao(sessionFactory);
}
Also used : Configuration(org.hibernate.cfg.Configuration) Before(org.junit.Before)

Example 72 with Configuration

use of org.hibernate.cfg.Configuration in project API by ca-cwds.

the class StaffPersonDaoIT method beforeClass.

@SuppressWarnings("javadoc")
@BeforeClass
public static void beforeClass() {
    sessionFactory = new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
    staffPersonDao = new StaffPersonDao(sessionFactory);
}
Also used : Configuration(org.hibernate.cfg.Configuration) BeforeClass(org.junit.BeforeClass)

Example 73 with Configuration

use of org.hibernate.cfg.Configuration in project API by ca-cwds.

the class PhoneNumberDaoIT method beforeClass.

@SuppressWarnings("javadoc")
@BeforeClass
public static void beforeClass() {
    sessionFactory = new Configuration().configure("ns-hibernate.cfg.xml").buildSessionFactory();
    phoneDao = new PhoneNumberDao(sessionFactory);
}
Also used : Configuration(org.hibernate.cfg.Configuration) BeforeClass(org.junit.BeforeClass)

Example 74 with Configuration

use of org.hibernate.cfg.Configuration in project API by ca-cwds.

the class AddressDaoIT method beforeClass.

@SuppressWarnings("javadoc")
@BeforeClass
public static void beforeClass() {
    sessionFactory = new Configuration().configure("ns-hibernate.cfg.xml").buildSessionFactory();
    addressDao = new AddressDao(sessionFactory);
}
Also used : Configuration(org.hibernate.cfg.Configuration) BeforeClass(org.junit.BeforeClass)

Example 75 with Configuration

use of org.hibernate.cfg.Configuration in project ignite by apache.

the class CacheHibernateStoreSessionListenerSelfTest method sessionListenerFactory.

/**
 * {@inheritDoc}
 */
@Override
protected Factory<CacheStoreSessionListener> sessionListenerFactory() {
    return new Factory<CacheStoreSessionListener>() {

        @Override
        public CacheStoreSessionListener create() {
            CacheHibernateStoreSessionListener lsnr = new CacheHibernateStoreSessionListener();
            SessionFactory sesFactory = new Configuration().setProperty("hibernate.connection.url", URL).addAnnotatedClass(Table1.class).addAnnotatedClass(Table2.class).buildSessionFactory();
            lsnr.setSessionFactory(sesFactory);
            return lsnr;
        }
    };
}
Also used : SessionFactory(org.hibernate.SessionFactory) Configuration(org.hibernate.cfg.Configuration) Factory(javax.cache.configuration.Factory) SessionFactory(org.hibernate.SessionFactory)

Aggregations

Configuration (org.hibernate.cfg.Configuration)190 Test (org.junit.Test)66 Session (org.hibernate.Session)37 SessionFactory (org.hibernate.SessionFactory)35 SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)27 Before (org.junit.Before)20 BeforeClass (org.junit.BeforeClass)20 File (java.io.File)18 ServiceRegistry (org.hibernate.service.ServiceRegistry)14 Properties (java.util.Properties)13 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)9 HibernateException (org.hibernate.HibernateException)8 EncapsulatedCompositeIdResultSetProcessorTest (org.hibernate.test.loadplans.process.EncapsulatedCompositeIdResultSetProcessorTest)8 MappingException (org.hibernate.MappingException)7 Transaction (org.hibernate.Transaction)7 URL (java.net.URL)6 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)6 TestForIssue (org.hibernate.testing.TestForIssue)6 EntityTuplizer (org.hibernate.tuple.entity.EntityTuplizer)6 BigDecimal (java.math.BigDecimal)5