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: Mapping a table with column to two different objects.
PostPosted: Thu Nov 13, 2008 12:57 pm 
Newbie

Joined: Wed Aug 22, 2007 5:09 pm
Posts: 5
Hibernate version: Nhibernate 1.2

Name and version of the database you are using: MSSQL 2005

Hello, I realize the topic isn't much to go off of (being as why I have had a lot of trouble trying to search for my issue)

Basically what is going on is that I have a table

ID
Type
ItemID
etc...

The ItemID is an id that will load one of two objects(tables), and the type is my discriminator value.

I dont want to subclass, I just want it to be a many-to-one paying attention the Type.

The problem that I am having of course is mapping this. I am not sure how to tell the mapping to discriminate on these. I know the discriminator value exists when subclassing, but I'd rather not do that. I need to update this table too as there are columns that need persisting due to the line items.

If anyone can offer up a suggestion, I would appreciate it.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 13, 2008 1:09 pm 
Newbie

Joined: Wed Aug 22, 2007 5:09 pm
Posts: 5
To be clear, I was trying to avoid the Interface method, because this action is more so a "lineitem" than anything.


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.