Hello I have the following mapping. An employee is a Person. I wish to select(Using HQL) only those who are persons and not employees.
Here is my mapping file
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<!-- Created Fri Jan 07 11:24:24 PST 2005 -->
<hibernate-mapping package="data">
<class name="Person" table="person">
<id name="personId" column="Person_ID" type="java.lang.Integer">
<generator class="native"/>
</id>
<property name="handle" column="Handle" type="java.lang.String" not-null="true" />
<property name="password" column="Password" type="java.lang.String" not-null="true" />
<property name="createddate" column="CreatedDate" type="java.lang.Long" not-null="true" />
<property name="name" column="FullName" type="java.lang.String" not-null="true" />
<set name="projects" table="person_is_related_to_project" inverse="false" cascade ="all">
<key column="FK_Person_ID"/>
<many-to-many column="FK_Project_ID" class ="data.Project"/>
</set>
<joined-subclass name="Employee" table="employee">
<key column="Employee_ID"/>
</joined-subclass>
</class>
</hibernate-mapping>