-->
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.  [ 3 posts ] 
Author Message
 Post subject: load a subclass when the subclass type is unknown.
PostPosted: Tue Dec 20, 2005 3:32 pm 
Hi, I have a data model that worked with nHibernate 0.8 and does
not work with nHibernate 1.0.1: I have a base class Car
that that joined subclasses FunCar and WorkCar. Now the only
thing I know is that I have a car with ID=34.

In nHibernate 0.8 when I executed
Car car =_session.load(typeof(Car), 34)
and nHibernate determined that this instance of car was
a FunCar then the returned type has been FunCar.

In the new version this does not work anymore!!!

For sure Car car =_session.load(typeof(FunCar), 34)
would return a FunCar, but this only works if you know what
type your object is. I don't know the type and do rely very
heavily on receiving the proper type on such a Load.

What can be done?

Best regards
florian.


Top
  
 
 Post subject:
PostPosted: Tue Dec 20, 2005 6:27 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
I've just tested it on a simple test case and it worked all right. If you are sure it's an error in NHibernate, please open a JIRA issue and provide a minimal test case.


Top
 Profile  
 
 Post subject: subclass does not work anyore.
PostPosted: Wed Dec 21, 2005 7:40 am 
dear sergey. thank you for your fast help. I appreciate it very much!!!
I have been using the same code and the same mapping files as in
0.80; this is the error message I do get:

I translate "Die angegebene Umwandlung ist ung


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.