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: Entity with many parents without ForeignKey for every Parent
PostPosted: Thu Aug 14, 2008 6:04 am 
Newbie

Joined: Fri Apr 18, 2008 4:22 am
Posts: 3
Location: Germany
Hi, I use Hibernate 2.0.5 and have a question about mapping,

in our business model we have a entity wich can be a child collection of many other entities, like attachment entity wich can be assignet to part as image, to invoice as pdf and so on.

normaly I have to add foreign key to attachment table for every parent entity and change every time the table.

my attempt is to save a entity class id, such as type name of entity, instead of foreign key for every parent entity and a parents object id.

how I can realize this in NHibernate ??? Can I map this or should I write my own geter functions and use criteria ?


best regards

Russlan A.


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.