Null Pointer Exception when using @NotAudited on an entity with discriminator column,
inherited from base entity with InheritanceType.SINGLE_TABLE
--------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-4041
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4041
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.3.1
Reporter: Priya M
Using latest Envers version -- 1.2.1GA
This is my mapping:
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
class Foo {
}
@Entity
@DiscriminatorValue("bar")
class Bar {
}
@Entity
@Audited
class FooBarTest {
@NotAudited
Bar bar;
}
I get a NPE exception!
Caused by: java.lang.NullPointerException
at
org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateInheritanceMappingData(AuditMetadataGenerator.java:305)
at
org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:349)
at
org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:87)
at
org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:86)
at
org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)
at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:260)
at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
Right now, I'm forced to make Foo as @Audited even though I don't intend to.
--
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