Dear all, Hibernate 4.2.3 with OSGI support, that's a very good news and i have successfully integrated it into my application. But the OSGISessionFactoryService only searching for the configuration file "
hibernate.cfg.xml" in default directory of the "requestingBundle", e.g the root directory of the bundle. Let take an example
I have a bundle com.example.a of which the directory look like :
com.example.a
--src
-----com.example.a.model
-----(other packages)
--hibernate.cfg.xmlThis will work. But i want to put the hibernate.cfg.xml into a folder ,such as /Configuration/hibernate.cfg.xml , so how can i make it when inside the source code of the OSGISessionFactoryService i don't see where i can do.
Here is the method that's create the SessionFactory
Code:
@Override
public Object getService(Bundle requestingBundle, ServiceRegistration registration) {
osgiClassLoader.addBundle( requestingBundle );
Configuration configuration = new Configuration();
configuration.getProperties().put( AvailableSettings.JTA_PLATFORM, osgiJtaPlatform );
[b]configuration.configure();[/b]
........
return configuration.buildSessionFactory(serviceRegistry);
}