]
Hernán Chanfreau updated HHH-4063:
----------------------------------
Attachment: interfaceMappingSupportPatch.txt
Uploading a patch for supporting mapped interfaces and solve this issue.
Here is a discussion:
Thanks. Hernán.
NPE reading metadata from an mapped interface
---------------------------------------------
Key: HHH-4063
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4063
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.3.2
Environment: Hibernate-core 3.3.2GA, Envers 1.2.1GA
Reporter: Hernán Chanfreau
Attachments: interface.mapping.test.zip, interfaceMappingSupportPatch.txt
The problem arises when there is a mapped interface to load as a persistent class.
The metadata reader from envers do not care about interfaces.
See the discussion about it here:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=156233
We've patch envers doing this:
In AuditedPropertiesReader.addPropertiesFromClass(XClass clazz) we add the condition
superclazz != null.
private void addPropertiesFromClass(XClass clazz) {
XClass superclazz = clazz.getSuperclass();
// superclazz != null applies when superclazz is an interface
if ((superclazz != null) &&
(!"java.lang.Object".equals(superclazz.getName()))) {
addPropertiesFromClass(superclazz);
}
addFromProperties(clazz.getDeclaredProperties("field"), "field",
fieldAccessedPersistentProperties);
addFromProperties(clazz.getDeclaredProperties("property"),
"property", propertyAccessedPersistentProperties);
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: