Hibernate version:
NHibernate 1.2
Mapping documents:
Code:
<class name="Person" table="Person" lazy="false">
<id name="ID" column="ID" type="Int32" unsaved-value="-1">
<generator class="native"/>
</id>
<property column="Forename" type="String" name="Forename" length="50" />
<property column="Surname" type="String" name="Surname" length="50" />
</class>
<joined-subclass name="Employee" extends="Person" table="Employee" lazy="false">
<key column="PersonID" />
<property column="LoginName" type="String" name="LoginName" length="50" />
</joined-subclass>
Name and version of the database you are using:
SQL Server 2005
Hi All,
As you can see above, we have two entity types, Person and Employee, which are treated polymorphically (i.e. Employee derives from Person) and uses the table-per-subclass approach. I'm struggling to find a NHibernate query (pref using a Criteria expression rather than HQL) which will give me all Person entities that are
not Employees. Please can someone suggest some way of doing this?
TIA,
John