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

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