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: Mapping problem causing "WrongClassException"
PostPosted: Thu Nov 08, 2007 5:42 pm 
Newbie

Joined: Thu Sep 27, 2007 4:37 pm
Posts: 4
I have a situation where I have table "a" representing class type "A", table "b" representing class type B, derived from A, and table "c", representing class type C, also derived from A. So, from an object perspective, it seems simple "B and C are derived from A"

For some reason, the original developers have seen fit to allow rows, with the same identifier, in B and C, at the same time. So rather than the expected situation where an instance of "B" causes rows in b&a, or and instance of "C" causes rows in c&a, i have situation where there can be rows in a,b,c, all for the same object. From the point of view of objects, it seems that an instance can be both "B" and "C" at the same time.

I've currently mapped this with B and C being <joined-subclass> of A. However, NHibernate seems to get confused and throw "WrongClassException" when trying to fetch instances.

Is there a better mapping I could chose? I don't imagine that this type of problem is unique to me; has anyone else run into it?


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.