Beginner |
 |
Joined: Tue Nov 09, 2004 6:26 am Posts: 32
|
[b]Mapping documents:[/b]
<class name="Person" table="PERSON">
...
<set name="subjectAddress" lazy="true">
<key column="SUBJECT_ID"/>
<one-to-many
class="SubjectAddress"/>
</set>
</class>
<class name="SubjectAddress"
table="SUBJECT_ADDRESS">
...
<many-to-one name="emailAddress"
class="EmailAddress"
column="ADDRESS_ID"
outer-join="true" insert="false" update="false"
cascade="none"/>
</class>
Whe I get one Person
select pers from Person where pers.subjectId=:sid
I get an:
No row with the given identifier exists: 2528, of class: EmailAddress
because that person doesn't have an email address.
What am I doing wrong in preventing Hibernate loding the entire object graph?
|
|