[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3773) NPE when generating schema containing OneToMany relations

Lajos Gathy (JIRA) noreply at atlassian.com
Tue May 12 10:57:13 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33146#action_33146 ] 

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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list