Search in sources :

Example 1 with AnnotationConfiguration

use of org.hibernate.cfg.AnnotationConfiguration in project jbosstools-hibernate by jbosstools.

the class ServiceImpl method newAnnotationConfiguration.

@Override
public IConfiguration newAnnotationConfiguration() {
    getUsageTracker().trackNewConfigurationEvent(HIBERNATE_VERSION);
    Configuration configuration = new AnnotationConfiguration();
    return facadeFactory.createConfiguration(configuration);
}
Also used : Ejb3Configuration(org.hibernate.ejb.Ejb3Configuration) Configuration(org.hibernate.cfg.Configuration) JDBCMetaDataConfiguration(org.hibernate.cfg.JDBCMetaDataConfiguration) AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration)

Example 2 with AnnotationConfiguration

use of org.hibernate.cfg.AnnotationConfiguration in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewAnnotationConfiguration.

@Test
public void testNewAnnotationConfiguration() {
    IConfiguration configuration = service.newAnnotationConfiguration();
    Assert.assertNotNull(configuration);
    Object target = ((IFacade) configuration).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof AnnotationConfiguration);
}
Also used : AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Example 3 with AnnotationConfiguration

use of org.hibernate.cfg.AnnotationConfiguration in project onebusaway-application-modules by camsys.

the class DatabaseCachingGeocoderImplTest method setup.

@Before
public void setup() {
    Configuration config = new AnnotationConfiguration();
    config = config.configure("org/onebusaway/geocoder/impl/hibernate-configuration.xml");
    _sessionFactory = config.buildSessionFactory();
}
Also used : Configuration(org.hibernate.cfg.Configuration) AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration) AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration) Before(org.junit.Before)

Example 4 with AnnotationConfiguration

use of org.hibernate.cfg.AnnotationConfiguration in project selenium_java by sergueik.

the class HibernateUtil method getConfig.

private static Configuration getConfig(final Properties extraProperties) throws HibernateException {
    LOGGER.log(Level.INFO, Messages.HibernateUtil_LoadConfig());
    final Configuration config = new AnnotationConfiguration().configure();
    if ((extraProperties != null) && !extraProperties.isEmpty()) {
        LOGGER.log(Level.FINE, Messages.HibernateUtil_SettingExtraProps());
        LOGGER.log(Level.FINE, extraProperties.toString());
        config.addProperties(extraProperties);
    }
    return config;
}
Also used : Configuration(org.hibernate.cfg.Configuration) AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration) AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration)

Example 5 with AnnotationConfiguration

use of org.hibernate.cfg.AnnotationConfiguration in project onebusaway-application-modules by camsys.

the class UserReportingDaoImplTest method setup.

@Before
public void setup() throws IOException {
    _dao = new UserReportingDaoImpl();
    Configuration config = new AnnotationConfiguration();
    config = config.configure("org/onebusaway/transit_data_federation/hibernate-configuration.xml");
    _sessionFactory = config.buildSessionFactory();
    _dao.setSessionFactory(_sessionFactory);
}
Also used : AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration) Configuration(org.hibernate.cfg.Configuration) AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration) Before(org.junit.Before)

Aggregations

AnnotationConfiguration (org.hibernate.cfg.AnnotationConfiguration)6 Configuration (org.hibernate.cfg.Configuration)5 Before (org.junit.Before)3 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)2 JDBCMetaDataConfiguration (org.hibernate.cfg.JDBCMetaDataConfiguration)1 Ejb3Configuration (org.hibernate.ejb.Ejb3Configuration)1 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)1 Test (org.junit.Test)1