Console:
Hibernate: select email0_.emailid as emailid1_, email0_.email as email14_1_, email0_.personid as personid14_1_, person1_.personid as personid0_, person1_.person_name as person2_12_0_ from email email0_ left outer join Person person1_ on email0_.personid=person1_.personid where email0_.emailid=?
Code:
public void testLoadMany2One() {
Email email = (Email) session.load(Email.class, 1);
email.getEmail();
tx.commit();
session.close();
}
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping >
<class name="hibernateSpring.Email" table="email" >
<id name="emailID" column="emailid" type="int" unsaved-value="0">
<generator class="increment" />
</id>
<property name="email" column="email" type="java.lang.String" not-null="false" length="20" />
<many-to-one name="person" class="hibernateSpring.Person" cascade="save-update"
column="personid" />
</class>
</hibernate-mapping>