-->
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: The subclass with same id in two tables
PostPosted: Fri Aug 31, 2007 6:08 am 
Newbie

Joined: Fri Aug 31, 2007 6:02 am
Posts: 2
Hello,
Is it possible to have the same object in two subtables. Let's say I've got class User (stored in User table) and two classes UserType1 extends User (stored in User1 table) and UserType2 extends User (stored in User2 table). Now i've got the table wwwUser where is record with userid 6. This userid is in the table User1 and User2 because this user is UserType1 and also UserType2. How to solve this? Now I've got error:

Code:
org.hibernate.WrongClassException: Object with id: 6 was not of the specified subclass


Best regards,
Maciej Matecki


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 31, 2007 8:39 am 
Regular
Regular

Joined: Thu Oct 19, 2006 12:07 pm
Posts: 75
How can one object be an instance of two classes ?

(you also forgot the required data...)


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.