Hi,
I got PropertynotfoundException in assigning a property to a set. Below is a snippet of hbm.xml file.
Code:
<set name="treserveFactors" table="REPORTER.TRESERVE_FACTOR">
<key column="ANNUAL_STMT_LN_ID"/>
<composite-element class="icp.entity.TreserveFactor">
<property name="measureId" type="icp.entity.TreserveFactorPK" access="icp.entity.EventPropertyAccessor" column="MEASURE_ID"/>
.
.
.
</set>
I am not able to get the measureId property. The set is collection of table object TRESERVE_FACTOR. MEASURE_ID is one of the primay keys of the table TRESERVE_FACTOR.
When I created a POJO class for this table the system created two POJO classes,
TreserveFactorPK -- POJO class for all the primary key of the table TRESERVE_FACTOR.
TreserveFactor -- POJO class for the table TRESERVE_FACTOR. This class contains TreserveFactorPK as one of the class member.
Now, I have defined the EventPropertyAccessor class which implements the PropertyAccessor interface.
Code:
<property name="measureId" type="icp.entity.TreserveFactorPK" access="icp.entity.EventPropertyAccessor" column="MEASURE_ID"/>
The measureId is primary key of the table TRESERVE_FACTOR. But, it is member only in
TreserveFactorPK POJO class. This class is a POJO class of primary keys of the table TRESERVE_FACTOR.
I have defined the type ="icp.entity.TreserveFactorPK" here, because it measureID is a member of TreserveFactorPK class. But, I am getting the following exception,
Code:
Initial SessionFactory creation failed.org.hibernate.PropertyNotFoundException: Could not find a getter for measureId in class icp.entity.TreserveFactor
In debugging, I found that the class name it passes is icp.entity.TreserveFactor. But, I have defiend the type ="icp.entity.TreserveFactorPK".
But, the class value it takes it from
Code:
<composite-element class="icp.entity.TreserveFactor">
But, the property measureId is not defined in TreserveFactor.
Anyone help me???????????