-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate OSGI with custom directory for configuration
PostPosted: Tue Aug 06, 2013 9:49 pm 
Newbie

Joined: Tue Aug 06, 2013 9:36 pm
Posts: 1
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.xml

This 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);
   }


Top
 Profile  
 
 Post subject: Re: Hibernate OSGI with custom directory for configuration
PostPosted: Tue Sep 24, 2013 7:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 18, 2012 5:03 am
Posts: 36
Location: Fort Wayne, Indiana, USA
Great catch -- I'll take care of it in https://hibernate.atlassian.net/browse/HHH-8553.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.