[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2843) org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of natural Key component

joe woitas (JIRA) noreply at atlassian.com
Wed Jan 21 15:11:39 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32173#action_32173 ] 

joe woitas commented on HHH-2843:
---------------------------------

I cam across this bug and found the(a) solution that works for me.  it may or may not be the same problem others are having.  I had an object that was mapped as a many-to-one to another object.  the getter for this was called getRebuyItem(), just below that getter method I had a non-hibernated method which looks like the following.

public boolean isRebuyItem()
{
   return getRebuyItem() != null;
}

Hibernate choked because it doesn't consider the "is" or "get" portion of the method names when using reflection and happened to use the isRebutItem() in the wrong place.  causing this exception.  the fix is simple, i renamed my boolean method to isRebuy().

> org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of natural Key component
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-2843
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2843
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.3
>         Environment: Linux
>            Reporter: Charles Canning
>
> The full description is here in the forums: http://forum.hibernate.org/viewtopic.php?t=979408
> I will provide more details if I can. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list