Using custom PropertyAccessor without specifying "type" may result in unexpected exception.

Description

For a java class using member variable prefixes:

This will work:
<id name="_id" access="field">

This will not:
<id name="id" access="my.UnderscoreFieldAccessor">

... and results in a misleading "org.hibernate.PropertyNotFoundException: field not found: id". This is due to the configuration binding process assuming the property type should be accessible via reflection (i.e., tries to reflect on field "id" which does not exist).

After tracing the cause, it's reasonable that "type" must to be specified absent other means of determining the property class, but the documentation doesn't mention it, and the condition checking to determine the appropriate exception is insufficient.

Activity

Brett MeyerMarch 3, 2014 at 3:40 PM

Bulk rejecting issues lacking a test case or recent response.

Brett MeyerDecember 19, 2013 at 10:31 PM

Note: In an attempt to clean up the HHH JIRA, we will be rejecting any ticket that sits in the "Awaiting Test Case" state for 2-3 months with no response. So, if this issue is critical to you, please attach a reproducing test case ASAP. Thanks!

Brett MeyerDecember 18, 2013 at 8:28 PM

If this is still an issue on ORM 4.2 or 4.3, anyone have a test case to attach?

Rejected

Details

Assignee

Reporter

Affects versions

Priority

Created July 5, 2006 at 8:05 AM
Updated March 3, 2014 at 3:40 PM
Resolved March 3, 2014 at 3:40 PM