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: Unwanted derived objects being loaded
PostPosted: Mon Aug 28, 2006 4:57 pm 
Newbie

Joined: Wed Apr 12, 2006 10:58 am
Posts: 3
We have two classes, Person and PersonLite. Person inhertits from PersonLite which contains a subset of the properties that Person contains. Both Person and PersonLite have a mapping file that points to a table named Person.

When performing a search using criteria for
Code:
typeof(PersonLite)
, the results contain the wanted PersonLite object but also an unwanted Person object for the same record.

1. If we ask for objects of type PersonLite, why does NHibernate include Person objects?

2. Is there a way to stop NHibernate from loading Person objects?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 28, 2006 5:12 pm 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
how your mapping files look like? Check the docs for explicit/implicit polymorphism in the class tag. Try to put polymorphism="explicit" and see what happens.

hth,
radu


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.