[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3773?page=c...
]
Lajos Gathy commented on HHH-3773:
----------------------------------
I guess you should just mask the "field containing the relation from P to Cs"
with the @NotAudited annotation, because if you mark P with @Audited it automatically
considers every attribute of P to be audited while exclusions could be added with marking
attributes with @NotAudited.
NPE when generating schema containing OneToMany relations
----------------------------------------------------------
Key: HHH-3773
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3773
Project: Hibernate Core
Issue Type: Bug
Components: envers
Reporter: Tobias Hill
I have an entity P having a one-to-many relation to an entity C.
I mark P as @Audited.
I do not mark C as @Audited.
Neither do I mark the field containing the relation from P to Cs.
When building the schema I get:
java.lang.NullPointerException
at
org.hibernate.envers.configuration.metadata.CollectionMetadataGenerator.addOneToManyAttached(CollectionMetadataGenerator.java:164)
at
org.hibernate.envers.configuration.metadata.CollectionMetadataGenerator.addCollection(CollectionMetadataGenerator.java:150)
at
org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.addValue(AuditMetadataGenerator.java:141)
at
org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.addProperties(AuditMetadataGenerator.java:161)
at
org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateSecondPass(AuditMetadataGenerator.java:385)
If I mark C as @Audited it goes away and the schema is generated as supposed 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