From: J.C. v. V. (JIRA) <no...@at...> - 2006-07-05 06:05:58
|
Using custom PropertyAccessor without specifying "type" may result in unexpected exception. ------------------------------------------------------------------------------------------- Key: HHH-1878 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1878 Project: Hibernate3 Type: Bug Versions: 3.1.2 Reporter: J.C. van Vorst Priority: Minor 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. -- 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 |