Dec 15th, 2005, 10:05 AM
populate mappingResources in runtime (hibernate)
I have multiple sessionFactories that I define in the applicationContext.xml.
I define one session factory (sessionFactory1) with a lot of mapping resources files. I would extract from Java code this list of values to inject in sessionFactory2,... but when I get the bean sessionFactory1, I have an object of type "SessionFactory" and not "LocalSessionFactoryBean".
--> I don't have the good methods in this interface to do that.
Is there a solution to that problem ?
<bean id="sessionFactory1" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
<bean id="sessionFactory2" ....
Dec 15th, 2005, 12:47 PM
Why do you want to do that ?
If you don't want write each time the reference to mapping resources, you can use the following declaration in your config file:
foo/faa/fii are packages name
Dec 16th, 2005, 03:38 AM
ok, thanks for your reply