-->
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.  [ 3 posts ] 
Author Message
 Post subject: Complex Association Question
PostPosted: Fri Jun 03, 2005 10:14 am 
Newbie

Joined: Thu Jun 02, 2005 11:29 pm
Posts: 2
Hi,

I've inherited a database schema where a single Relationship table is responsible for all the associations between tables, and the Relationship table stores the relationship_type, left_side and right_side columns.

So, if I have 4 tables:

* User
* Company
* Address
* Telephone

and the Relationship table, the relationship_type would be used to determine whether a row in the Relationship was mapping:

* User to Company
* User to Address
* Company to Address
* User to Telephone
* etc

Is there any way to configure Hibernate to cope with such a DB Schema? I have looked at the Hibernate Reference Documentation, but didn't see anything in the chapter about Associations which suggests that this is possible.

Unfortunately at this time, changing the schema is not an option.

Thanks!!

B[/list]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 1:22 pm 
Newbie

Joined: Mon Sep 22, 2003 11:00 am
Posts: 1
Were you able to solve this problem? I'm up against a very similar schema.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 5:27 pm 
Newbie

Joined: Thu Jun 02, 2005 11:29 pm
Posts: 2
I've had 2 suggestions:

1) Use descriminators
2) Use a where clause

haven't investigated either yet. I'd be interested to hear about any progress you make.


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

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.