[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-4063) NPE reading metadata from an mapped interface
Adam Warski (JIRA)
noreply at atlassian.com
Thu Jan 7 09:57:29 EST 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4063?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Warski resolved HHH-4063.
------------------------------
Resolution: Fixed
Fix Version/s: 3.5
> 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
> Assignee: Adam Warski
> Fix For: 3.5
>
> 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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list