-->
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: help with table-per-class-hierarchy
PostPosted: Mon Mar 12, 2007 2:37 pm 
Newbie

Joined: Mon Mar 12, 2007 2:23 pm
Posts: 1
Hi,

I am new to Hibernate and I am facing some trouble making table-per-class-hierarchy work.

The problem: I have a abstract base class by name Person (mapped to table PERSON in the database) and 2 concrete extensions to Person with names, Employee and Student. There are no properties specific to either of these subclasses. I want the database field called PROFESSION to be used as a discriminator to instantiate either Employee or Student.

When I try to do this, the query on the abstract base class, "from Person" is always returning all the objects with type corresponding to the first discriminator value found in the database.

Please advise.

Thank you
prakashn


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.