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

Tobias Hill (JIRA) noreply at atlassian.com
Wed Feb 11 02:58:40 EST 2009


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