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 across databases
PostPosted: Tue Apr 15, 2008 2:36 pm 
Newbie

Joined: Tue Apr 15, 2008 2:29 pm
Posts: 1
Hello,

Is it possibly to map an association across databases? I have one database that contains Users and Roles, each User is assigned one or more Roles. All of that works fine.

I have another database that defines resources. We have a ProtectedResource class that contains a Resource, and a Role that can access it. Is it possible to have Hibernate read the ProtectedResource from a database, and populate the Role property in ProtectedResource with an object from a different database?

Is it a completely horrible design to have a table in one database reference a PK from a table in a different database? Would it be better for the ProtectedResource table to reference business data for the Role (ie, the role name) instead of the PK, and manually look up the Role when the ProtectedResource object is created?

Thanks for any help!

Kelly


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.