i have one header table(table1) and three child tables (table2 and table3 and table 4) which are linked by the relationship as mentioned in the mapping file below.
i have a search screen in which i search based on some criteria and display the displayed the header details alone. but what i notice is that even-though i have given lazy="true" for all associations, the details are still fetched from table2, table3. in this the details of table 4 are not fetched (this is fine).
in the same way i need to stop details from table 2 and 3 to be fetched, as this is a search screen which can return 50-60 records and if fetches the other tables the process it getting slow.
please let me know how to make lazy-"true" work for one to one relationship and many-to-one relationship for tables 2 and 3.
Code:
<class name="test.Class1" table="Table1">
<id name="id" column="primary" type="int">
<generator class="native">
<param name="sequence">SEQ</param>
</generator>
</id>
<many-to-one name="class2" class="test.Class2"
column="tbl2_id" lazy="true" unique="true" cascade="none" />
<one-to-one name="class3" class="test.class3"
lazy="true" cascade ="all" />
<set name="class4List" lazy="true" inverse="true" cascade="all">
<key column="tbl4_id" not-null="true"/>
<one-to-many class="test.Class4"/>
</set>
</class>