Hi,
I have some performance problems, when initializing the RwpXVersRelevants-set with Hibernate.initialize(). When I take a look at the SQL-statements I see, that there is first a select on "X_VERS_RELEVANT" by "IDVAR". This returns a result of 8 rows. For every row there is another request on "X_VERS_RELEVANT" by "IDVAR" and "IDRELV".
The first select has all the information needed. So, why these selects for every row ?
Is there a way to prevent these selects ?
Hibernate version:
2.1.6
Mapping documents:
<class name="CatiaVariable" table="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="X_VERS_RELEVANT" lazy="true" inverse="true">
<key column="IDVAR" />
<one-to-many class="RwpXVersRelevant"/>
</set>
</class>
<class name="RwpXVersRelevant" table="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>
Thank you for any idea !
|