NHibernate Caching Objects Based on Parent Class's ID
问题 I have the following definitions for the Animal and Dog types. Note that the ID for the object is the AnimalID: <class name="Animal" table="Animals"> <id name="Id" type="System.Int32" column="AnimalID"> <generator class="identity" /> </id> <property name="IsBig" column="IsBig" type="System.Bool" not-null="true" /> </class> <joined-subclass name="Dog" table="Dogs" extends="Animal"> <key column="AnimalID" /> <property name="OwnerID" column="OwnerID" type="System.Int32" non-null="true" />