Hi,
I have below hibernate issue. Here is my configration.
Code:
<class name="org.xxx.xxx.xx.data.po.QwRptDefn" table="QW_RPT_DEFN">
........
<set name="prntClmns" lazy="true" inverse="true" order-by="sqnc_num" where="srt_only_sw='N'">
<key>
<column name="RPT_NUM"/>
</key>
<one-to-many class="org.xxxx.xx.xx.data.po.QwRptClmn"/>
</set>
</class>
<class name="org.xxxx.xx.xx.data.po.QwRptClmn" table="QW_RPT_CLMN">
........
<property name="srtOnlySw" type="yes_no" column="SRT_ONLY_SW" not-null="true" length="1"/>
</class>
// trying to get some records for origRptDefn.
for (Iterator it = origRptDefn.getPrntClmns().iterator(); it.hasNext();) {
hibernate query generates here for origRptDefn.getPrntClmns() correctly with srt_only_sw='N'
}
// trying to insert some records into QwRptClmn for qwRptDefn
for (Iterator it = qwRptDefn.getPrntClmns().iterator(); it.hasNext();) {
// getPrntClms suppose to get only records srt_only_sw is 'N' as defined in hbm file.
// I wounder this loop is geeting the records srt_only_sw is 'Y' also, where this record got saved just above.
// Tough I specified hibernate lazy is true, hibernate query is not generated here, but it got generated at the begining on origRptDefn.getPrntClmns(). I am not worry about this, but I am getting wrong record with srt_only_sw='Y' on qwRptDefn.getPrntClmns().Appreciate your help here.Thanks in advance
}
[/code]
Appreciate your help here.
Thanks in advance