[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4063?page=c...
]
Hernán Chanfreau commented on HHH-4063:
---------------------------------------
We realized that our solution only solves the NullPointerException, but still do not care
about interfaces.
For example, if B is "subinterface" of A, during the process of extracting the
audited metadata, AuditedPropertiesReader do not extract the metadata from interface A
as a superinterface of B. So you can loose audited properties...
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
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:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira