-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Selecting a superclass only
PostPosted: Mon Feb 21, 2005 9:49 am 
Newbie

Joined: Wed Jan 05, 2005 5:30 am
Posts: 14
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>



Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.