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: one-to-many to subclasses in the same table
PostPosted: Wed Apr 23, 2008 5:58 am 
Newbie

Joined: Wed Apr 16, 2008 4:15 am
Posts: 4
Location: Netherlands
Hi,
I have the following problem where I have a solution for but I was wiondering of it could be possible to solve it more elegantly.

I have a class with two one-to-many associations.

Code:
Class A

Class B1 Class B2


Classes B1 and B2 are in the same table because they are subclasses.
When nhibernate fetches the one-to-many list for for instance B1 it does not add the discriminator column with its value. I added this manually with a where attribute for the set. Does anyone know if it is possible to ommit the where attribute and get it working correctly?

Thanks

Hibernate version:
1.2.0.4000
Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

Code:


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.