-->
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: associations accross schemas / one side only
PostPosted: Sat Feb 12, 2005 12:27 pm 
Newbie

Joined: Thu Feb 03, 2005 11:40 pm
Posts: 8
Hi,

My application associates LDAP type information (user id, last name, etc.) with application specific information (additional user information that is not stored in LDAP). I would like to have two modules and swap them based on a configuration flag. One module accesses LDAP directly and the other simulates LDAP by using a table. I would like to house my DB module in a different schema than the application schema.

Obviously, there are associations between entities, such as a one to many association between the LDAP "table" and the Service table.

So, my first question is, "does Hibernate handle associations between entities that sit in different schemas?"

My second question is "can I have one side of the association managed by Hibernate and the other side managed separately (e.g., code that accesses LDAP directly)?"


I was assuming that the answer to the first question was "yes," but my code does not work and I was wondering if I was doing something wrong. I have two *.cfg.xml files that point to the two schemas.

ldap.cfg.xml
<mapping resource="com/acltd/madrigal/hibernate/Ldapuserinfo.hbm.xml"/>

hibernate.cfg.xml
<mapping resource="com/acltd/madrigal/hibernate/Sysservice.hbm.xml"/>

I use two session factories
ldapSessionFactory = cfg.configure("/ldap.cfg.xml").buildSessionFactory();
madrigalSessionFactory = cfg.configure().buildSessionFactory();

When the code initializes, I get the following error. What am I doing wrong?

Thanks,
Vladimir

18:37:48,626 INFO [Environment] Hibernate 2.1.7
18:37:48,636 INFO [Environment] hibernate.properties not found
18:37:48,646 INFO [Environment] using CGLIB reflection optimizer
18:37:48,646 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
18:37:48,646 INFO [Configuration] configuring from resource: /ldap.cfg.xml
18:37:48,646 INFO [Configuration] Configuration resource: /ldap.cfg.xml
18:37:48,786 INFO [Configuration] Mapping resource: com/acltd/madrigal/hibernat
e/Ldapuserinfo.hbm.xml
18:37:48,986 INFO [Binder] Mapping class: com.acltd.madrigal.hibernate.Ldapuserinfo -> LDAPUSERINFO
18:37:49,247 INFO [Binder] Mapping collection: com.acltd.madrigal.hibernate.Ldapuserinfo.sysprivs -> SYSUSERPRIV
18:37:49,247 INFO [Configuration] Configured SessionFactory: java:/hibernate/HibernateFactory
18:37:49,247 INFO [Configuration] processing one-to-many association mappings
18:37:49,257 INFO [STDOUT] net.sf.hibernate.MappingException: Association references unmapped class: com.acltd.madrigal.hibernate.Sysservice


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.