-->
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: Map several classes to the same table?
PostPosted: Thu Dec 16, 2004 6:46 am 
Newbie

Joined: Thu Nov 04, 2004 10:53 am
Posts: 2
Hi,

I would like to map several classes to the same DB table, in order to implement different "views" of a business object.

But I'm running into a problem: I keep getting Exceptions like this:

net.sf.hibernate.WrongClassException: Object with id: 15 was not of the specified subclass: de.ovsag.cool.data.person.model.PersonHandle (loaded object was of wrong class)

I think what's happening is this: the business object in question was already loaded in the same session as a different class, Person. When Hibernate later tries to load an object of class PersonHandle mapped to the same DB table and which has the same ID, it returns the already loaded object, which has the wrong class.

Is there any way to work around this problem?


Top
 Profile  
 
 Post subject: Actually a bug...
PostPosted: Thu Dec 16, 2004 2:12 pm 
Newbie

Joined: Thu Nov 04, 2004 10:53 am
Posts: 2
Well, turns out that my guess about the source of the problem was wrong, it
occurred only when mapping collections. And it seems to actually have been a bug in Hibernate that's already fixed - at least the problem disappeared when I upgraded to 2.1.7c from 2.1.6


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.