-->
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: Conditional Polymorphism - mapping question
PostPosted: Thu Apr 20, 2006 10:51 pm 
Newbie

Joined: Wed Dec 15, 2004 9:45 am
Posts: 7
This is a mapping question. I have a two objects that get associated to each other via one of two possible tables. So, for instance, object A has a reference to object B via table X or via table Y. See the following picture:

A-----X------B
or
A-----Y------B

The property on A and on B is the same in both cases. The keys on the join table are composite keys as they are on both A and B. Additionally, A is actually polymorphic itself (either union or implicit). See the following picture:

A
^
|
------
| |
M N

Object types M and N are related to their own tables with A being an interface (no table to create the polymorhic relationship).

Right now, I have had to implement the join referecences as two properties on both M and N. Fortunately the condition which decides whether the association goes through X or Y is mutually exclusive. However, it is not a simple column, but a calculation.

Can anyone think of a way to implement/map this using the same property? Is there a way to use a formula in the join to determine which table to join with??

Thanx for your time,
LES


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.