Results 1 to 3 of 3

Thread: populate mappingResources in runtime (hibernate)

  1. #1
    Join Date
    Sep 2005
    Posts
    11

    Default 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">
    <property name="mappingResources">
    <list>
    <value>com/model/businessobject/Cwd01_1.hbm.xml</value>
    .......................
    </list>
    ........

    <bean id="sessionFactory2" ....

  2. #2
    Join Date
    Dec 2005
    Location
    paris
    Posts
    13

    Default 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:

    <property name="mappingDirectoryLocations">
    <value>classpath*:foo/faa/fii</value>
    </property>

    foo/faa/fii are packages name

  3. #3
    Join Date
    Sep 2005
    Posts
    11

    Default

    ok, thanks for your reply

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •