-->
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.  [ 5 posts ] 
Author Message
 Post subject: Problems in mapping generic associations
PostPosted: Tue Oct 03, 2006 6:52 am 
Newbie

Joined: Tue Oct 03, 2006 6:28 am
Posts: 9
Hi,
I've got some problems in mapping my Data Model in Hibernate, I don't think it is an uncommon problem, but I didn't found anything about this in my searches...

My tables are these:
TableA : ID_ENTITYA (other A data)
TableB : ID_ENTITYB (other B data)
TableC : ID_ENTITYC (other C data)
TableD_Link_A_and_Entities: ID_D, ID_A (foreign key with TableA), TYPE_ENTITY, ID_ENTITY

My problem is to mapping the generic associations described by TableD_Link_A_and_Entities where the couple of columns TYPE_ENTITY, ID_ENTITY specify the entity associated with EntityA (ex. if TYPE_ENTITY=B then it's an EntityB, if TYPE_ENTITY=C then it's an EntityC)

I'd like to have a resulting Persisten Class like this:
Class EntityA {
getEntitiesB()
getEntitiesC()
...
}

Any suggestions?

Hibernate version:3.1

Name and version of the database you are using: Oracle 10


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 12:20 pm 
Newbie

Joined: Tue Oct 03, 2006 6:28 am
Posts: 9
nobody?

Every suggestion is appreciated!!! Indeed!!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 3:09 am 
Newbie

Joined: Tue Oct 03, 2006 6:28 am
Posts: 9
up


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 1:43 pm 
Newbie

Joined: Tue Oct 03, 2006 6:28 am
Posts: 9
Quote:
I don't think it is an uncommon problem

maybe i was wrong....
:(


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 08, 2006 4:46 am 
Newbie

Joined: Tue Oct 03, 2006 6:28 am
Posts: 9
:(


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