-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: failed org.hibernate.PropertyNotFoundException:
PostPosted: Wed May 27, 2009 6:07 pm 
Newbie

Joined: Fri May 22, 2009 11:14 am
Posts: 3
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???????????


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.