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.  [ 1 post ] 
Author Message
 Post subject: Create Association between multiple databases
PostPosted: Fri Jan 22, 2010 3:28 am 
Newbie

Joined: Mon Oct 13, 2008 8:56 am
Posts: 4
How do I create association between multiple databases or catalogs.
I have created two different session factories for two databases:
Code:
<bean id="objSessionFactory1" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref local="objDataSource1"/>
        </property>
       
        <property name="mappingResources">
            <list>
                <value>Test1.hbm.xml</value>
...

Code:
<bean id="objSessionFactory2" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref local="objDataSource2"/>
        </property>
       
        <property name="mappingResources">
            <list>
                <value>Test2.hbm.xml</value>
...


While creating association <many-to-one> I am getting error that
Code:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'objSessionFactory2' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: An association from the table refers to an unmapped class:

Please help as I need to use two different databases.


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

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.