Hi,
I am having an issue with a "Collection" not loading.
I am using lazy="false" in my hibernate mapping file.
One thing I have noticed is that if I use the ".get" method using the key object, the collecion does not load. However, if I find the row of data using a simple HQL query then the collection does load successfully.
I have tried using "Hibernate.initialize(...).
Not luck.
Any suggestions/ideas would be greatly appreciated !
<< HIBERNATE MAPPING >>
<hibernate-mapping package="us.nc.state.doc.ws.hibernate.bean.offender">
<class name="Ofnt7ih1" table="OFNV7IH1" lazy="false">
<composite-id name="id" class="Ofnt7ih1Id">
<key-property name="facilityId" type="string" column="CFFACLID" length="5" />
<key-property name="offenderNumber" type="string" column="CMDORNUM" length="7" />
<key-property name="intakeDate" type="date" column="INTKDATE" length="10" />
</composite-id>
<property name="intakeStatus" type="string" column="INTKSTAT" length="3" not-null="true" />
<property name="statusDate" type="date" column="STATUSDATE" length="10" not-null="true" />
<property name="dateOfEntry" type="date" column="DTOFENTRY" length="10" not-null="true" />
<property name="timestampOfEntry" type="timestamp" column="TSOFUPDT" length="26" not-null="true" />
<property name="staffOfUpdate" type="string" column="STFOFUPDT" length="5" not-null="true" />
<set name="detailItems" cascade="all" inverse="false" lazy="false">
<key>
<column name="CFFACLID"/>
<column name="CMDORNUM"/>
<column name="INTKDATE"/>
</key>
<one-to-many class="Ofnt7id1"/>
</set>
</class>
<class name="Ofnt7id1" table="OFNV7ID1">
<composite-id name="id" class="Ofnt7id1Id">
<key-property name="facilityId" type="string" column="CFFACLID" length="5" />
<key-property name="offenderNumber" type="string" column="CMDORNUM" length="7" />
<key-property name="intakeDate" type="date" column="INTKDATE" length="10" />
<key-property name="intakeTask" type="string" column="INTKTASK" length="3" />
<key-property name="timestampOfCreate" type="timestamp" column="TSOFCREAT" length="26" />
</composite-id>
<property name="staffIdOfInterview" type="string" column="INTKSTFID" length="5" not-null="true" />
<property name="taskDate" type="date" column="INTKTASKDT" length="10" not-null="true" />
<property name="interviewResponsibility" type="string" column="INTKRESP" length="2" not-null="true" />
<property name="interviewTaskOrder" type="long" column="INTKORDR" precision="4" scale="0" not-null="true" />
<property name="interviewTaskStatus" type="string" column="INTKSTFLG" length="1" not-null="true" />
<property name="timestampOfUpdate" type="timestamp" column="TSOFUPDT" length="26" not-null="true" />
<property name="staffOfUpdate" type="string" column="STFOFUPDT" length="5" not-null="true" />
</class>
</hibernate-mapping>
|