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.

Environment

None

Activity

Show:
Brett Meyer
December 18, 2013, 8:28 PM

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

Brett Meyer
December 19, 2013, 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 Meyer
March 3, 2014, 3:40 PM

Bulk rejecting issues lacking a test case or recent response.

Rejected

Assignee

Unassigned

Reporter

J.C. van Vorst

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Minor
Configure