Joined: Thu Oct 14, 2004 7:38 am Posts: 5
|
Hi,
I have some serious performance problems by lazy initializing the child records in an one-to-many Association.
When performing Hibernate.initialize(catiaVariable.getRwpXVersRelevants()) there is a lot more of SQL traffic I expected...
First there is a select on "RWP_X_VERS_RELEVANT" by column "IDVAR" (which I expected). There are n rows returned.
But then there is for every row a new select on "RWP_X_VERS_RELEVANT" by column "IDVAR" and "IDRELV" - I suppose to load the "RwpXVersRelevant". Is there a way to prevent these n select's ?
Hibernate version:
2.1.6
Mapping documents:
<class name="CatiaVariable" table="RWP_CATIAVD_VARIABLE">
<id name="id" type="integer" column="ID" >
<generator class="assigned"></generator>
</id>
<property name="name" column="VAR_NAME" type="string"/>
...
<set name="RwpXVersRelevants" table="RWP_X_VERS_RELEVANT" lazy="true" inverse="true">
<key column="IDVAR" />
<one-to-many class="RwpXVersRelevant"/>
</set>
</class>
<class name="RwpXVersRelevant" table="RWP_X_VERS_RELEVANT">
<composite-id>
<key-many-to-one name="catiaVariable" class="CatiaVariable" column="IDVAR" />
<key-many-to-one name="versRel" class="VersRel" column="IDRELV" />
</composite-id>
<property name="isDeleted" column="ISDELETED" type="boolean"/>
<property name="isRelevant" column="ISRELEVANT" type="boolean"/>
<property name="text" column="TEXT" type="string"/>
</class>
|
|