Beginner |
|
Joined: Tue Feb 05, 2013 10:04 am Posts: 20
|
Hello, I need to read the Hibernate configuration properties from a file name different that hibernate.cfg.xml
Following code works but is deprecated:
SessionFactory sessionFactory=new Configuration().configure("hibernate.content.cfg.xml").buildSessionFactory();
But when I try to use the new configuration method:
serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry(); sessionFactory = configuration.buildSessionFactory(serviceRegistry); ....
it doesn't work.
How should I get Hibernate to read a different configuration file?
Thank you.
|
|