Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 2.1.7c
Mapping documents:
I've stripped the example down to make it easier to understand:
Code:
<hibernate-mapping package="my.datamodel">
<class name="HibFamilyData" table="FAMILY">
<id name="id">
<generator class="native"/>
</id>
</class>
</hibernate-mapping>
<hibernate-mapping package="my.datamodel">
<class name="HibChildData" table="CHILD">
<id name="id">
<generator class="native"/>
</id>
<many-to-one
name="family" class="HibFamilyData" cascade="none">
<column name="FAMILY_ID"/>
</many-to-one>
</class>
</hibernate-mapping>
QuestionSay I have three child rows that have the same family_id, and I load each child [session.load(HibChildData.class, id)] row. When I do this I get a new instance of HibFamilyData for each row. I thought the HibFamilyData would be in the first level cache and therefore each HibChildData would have the same instance of HibFamilyData.
Can someone point out my error?
Thanks,
-John K[/code]