List of usage examples for org.hibernate.cfg Configuration configure
@Deprecated public Configuration configure(org.w3c.dom.Document document) throws HibernateException
From source file:org.onebusaway.gtfs.impl.HibernateGtfsRelationalDaoImplCaltrainTest.java
License:Apache License
@BeforeClass public static void setup() throws IOException { Configuration config = new Configuration(); config = config.configure("org/onebusaway/gtfs/hibernate-configuration.xml"); _sessionFactory = config.buildSessionFactory(); _dao = new HibernateGtfsRelationalDaoImpl(_sessionFactory); GtfsReader reader = new GtfsReader(); reader.setInputLocation(new File("src/test/resources/org/onebusaway/gtfs/caltrain.zip")); reader.setEntityStore(_dao);//from ww w . j a v a 2 s.com reader.setDefaultAgencyId(_agencyId); reader.run(); }
From source file:org.onebusaway.gtfs.impl.HibernateGtfsRelationalDaoImplTest.java
License:Apache License
@Before public void setup() throws IOException { Configuration config = new Configuration(); config = config.configure("org/onebusaway/gtfs/hibernate-configuration.xml"); _sessionFactory = config.buildSessionFactory(); _dao = new HibernateGtfsRelationalDaoImpl(_sessionFactory); _dao.open();//from www .j a va2 s. c o m }
From source file:org.onebusaway.gtfs.impl.HibernateGtfsRelationalImplBartTest.java
License:Apache License
@BeforeClass public static void setup() throws IOException { Configuration config = new Configuration(); config = config.configure("org/onebusaway/gtfs/hibernate-configuration.xml"); _sessionFactory = config.buildSessionFactory(); _dao = new HibernateGtfsRelationalDaoImpl(_sessionFactory); GtfsReader reader = new GtfsReader(); reader.setInputLocation(new File("src/test/resources/org/onebusaway/gtfs/bart.zip")); reader.setEntityStore(_dao);/*ww w . j av a 2 s . c o m*/ reader.setDefaultAgencyId(_agencyId); reader.run(); }
From source file:org.onebusaway.gtfs.impl.LongRouteDescriptionTest.java
License:Apache License
@BeforeClass public static void setup() throws IOException { Configuration config = new Configuration(); config = config.configure("org/onebusaway/gtfs/hibernate-configuration.xml"); _sessionFactory = config.buildSessionFactory(); _dao = new HibernateGtfsRelationalDaoImpl(_sessionFactory); GtfsReader reader = new GtfsReader(); reader.setInputLocation(new File("src/test/resources/org/onebusaway/gtfs/caltrain-long-route.zip")); reader.setEntityStore(_dao);//ww w .j a va 2s .c om reader.setDefaultAgencyId(_agencyId); List<Class<?>> entityClasses = reader.getEntityClasses(); entityClasses.clear(); entityClasses.add(Agency.class); entityClasses.add(Route.class); reader.run(); }
From source file:org.onebusaway.nyc.ops.impl.CcAndInferredLocationDaoImplTest.java
License:Apache License
@Before public void setup() throws IOException { Configuration config = new AnnotationConfiguration(); config = config.configure("org/onebusaway/nyc/ops/hibernate-configuration.xml"); _sessionFactory = config.buildSessionFactory(); _cache = new CcLocationCache(10); _dao = new CcAndInferredLocationDaoImpl(); _dao.setValidationService(new RecordValidationServiceImpl()); _dao.setSessionFactory(_sessionFactory); _dao.setCcLocationCache(_cache);/* w w w.ja v a 2s . c o m*/ }
From source file:org.onebusaway.nyc.report_archive.impl.ArchiveCcAndInferredLocationDaoImplTest.java
License:Apache License
@Before public void setup() throws IOException { Configuration config = new AnnotationConfiguration(); config = config.configure("org/onebusaway/nyc/report_archive/hibernate-configuration.xml"); _sessionFactory = config.buildSessionFactory(); _cache = new CcLocationCache(10); _dao = new ArchiveCcAndInferredLocationDaoImpl(); _dao.setValidationService(new RecordValidationServiceImpl()); _dao.setSessionFactory(_sessionFactory); _dao.setCcLocationCache(_cache);/*from w w w. j a va 2 s. c om*/ _ccDao = new CcLocationReportDaoImpl(); _ccDao.setSessionFactory(_sessionFactory); }
From source file:org.onebusaway.nyc.report_archive.impl.CcLocationReportDaoImplTest.java
License:Apache License
@Before public void setup() throws IOException { Configuration config = new AnnotationConfiguration(); config = config.configure("org/onebusaway/nyc/report_archive/hibernate-configuration.xml"); _sessionFactory = config.buildSessionFactory(); _dao = new CcLocationReportDaoImpl(); _dao.setSessionFactory(_sessionFactory); }
From source file:org.onebusaway.nyc.report_archive.impl.NycQueuedInferredLocationDaoImplTest.java
License:Apache License
@Before public void setup() throws IOException { Configuration config = new AnnotationConfiguration(); config = config.configure("org/onebusaway/nyc/report_archive/hibernate-configuration.xml"); _sessionFactory = config.buildSessionFactory(); _cache = new CcLocationCache(10); _dao = new NycQueuedInferredLocationDaoImpl(); _dao.setSessionFactory(_sessionFactory); _dao.setCcLocationCache(_cache);// w ww. j a v a 2 s . co m _ccDao = new CcLocationReportDaoImpl(); _ccDao.setSessionFactory(_sessionFactory); }
From source file:org.onebusaway.nyc.transit_data_manager.siri.SiriServiceDaoTest.java
License:Apache License
@Before public void setup() throws IOException { Configuration config = new AnnotationConfiguration(); config = config.configure("org/onebusaway/nyc/transit_data_manager/hibernate-configuration.xml"); _sessionFactory = config.buildSessionFactory(); _dao = new SiriServiceDao(); _dao.setSessionFactory(_sessionFactory); }
From source file:org.onebusaway.transit_data_federation.impl.reporting.UserReportingDaoImplTest.java
License:Apache License
@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); }