-->
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.  [ 2 posts ] 
Author Message
 Post subject: A valid usage for <join>?
PostPosted: Tue Jul 12, 2005 9:11 pm 
Senior
Senior

Joined: Thu May 12, 2005 11:40 pm
Posts: 125
Location: Canada
I have a schema like this

Code:
A <- A_B -> B
      |
A_B_OVERRIDE

A:
A_ID PK

B:
B_ID PK
DATE

A_B:
A_B_ID PK
A_ID FK
B_ID FK

A_B_OVERRIDE:
A_B_ID PK
DATE_OVERRIDE

A and B have a many-to-many relationship through association table A_B. The association table itself is exposed as an entity class, because there is a one-to-one hanging off of it that allows the owning entity of the relationship, A, to override an attribute of the owned entity B for the given relationship.

The override table itself as you can see is trivial, and is only used to avoid a nullable override column in A_B. Instead of mapping it as its own entity class, I use a <join> mapping to pull it into the class that maps A_B. This seems to work well and makes my code simple and easy to write.

What do you think?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 12, 2005 9:12 pm 
Senior
Senior

Joined: Thu May 12, 2005 11:40 pm
Posts: 125
Location: Canada
Ah crap.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.