-->
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: Object property (anonymous foreign reference)...
PostPosted: Thu Dec 08, 2005 4:11 am 
Newbie

Joined: Wed Aug 31, 2005 9:29 pm
Posts: 14
My appologies if this has been discussed before.

I have a table that is able to reference any other table. It does this by storing the table name and primary key of the foreign record in a pair of string fields.
What is the cleanest way to handle this?
I'm basically trying to avoid having to write the lookup code myself but still be able to use my objects as follows:

Code:
if (obj.Parent is Car)
    //do something
else if (obj.Parent is Horse)
    //do something else


Note that my "Car" and "Horse" objects in the above example do not inherit from anything common.
I'm also trying to keep my objects free from NHibernate references.

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 8:54 pm 
Newbie

Joined: Wed Aug 31, 2005 9:29 pm
Posts: 14
Solution:

http://forum.hibernate.org/viewtopic.php?p=2275624


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.