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?