I have two classes mapped in NHibernate: Dragon
and its subclass FierceDragon
, with a few FierceDragon
s stored stored in a table called Dragons
. When I run an HQL query like from Dragon...
I get back two objects per row: the expected FierceDragon
and an ordinary Dragon
that's a copy of the FierceDragon
(insofar as is possible; naturally it lacks the FierceDragon
's extra Ferocity
and TimeSinceLastMeal
properties). In particular, their IDs are identical. When I do from FierceDragon
I get only FierceDragon
s, with no extra copies, but that won't work for me in general.
Why does this happen, and how can I prevent it?