[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-4928) Non-Audited Entity with @ManyToOne in PK causes error in Envers 1.2.2

Adam Warski (JIRA) noreply at atlassian.com
Thu Feb 18 04:26:49 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adam Warski resolved HHH-4928.
------------------------------

       Resolution: Fixed
    Fix Version/s: 3.5.0-CR-2

> Non-Audited Entity with @ManyToOne in PK causes error in Envers 1.2.2
> ---------------------------------------------------------------------
>
>                 Key: HHH-4928
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4928
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: envers
>         Environment: Hibernate 3.3.2, Envers 1.2.2, Oracle 10.2
>            Reporter: Jeff Quandt
>            Assignee: Adam Warski
>             Fix For: 3.5.0-CR-2
>
>         Attachments: enversError.txt
>
>
> From http://community.jboss.org/thread/148209?tstart=0:
> We've been using Envers 1.2.1.GA w/ Hibernate 3.3.2.GA for some time now.  I'm attempting to update to 1.2.2 to make use of the RelationTargetAuditMode.NOT_AUDITED feature.  However, simply dropping the new library in place with no code changes gives the attached stack trace.  Truncated version below.
>  
> Including the RelationTargetAuditMode.NOT_AUDITED parameter or @NotAudited on all audited ManyToOne relationships made no difference.
> org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.ioc.spring.contextLoader
> ...
> Caused by: org.hibernate.HibernateException: could not init listeners
> ...
> Caused by: org.hibernate.MappingException: Type not supported: org.hibernate.type.ManyToOneType
>     at org.hibernate.envers.configuration.metadata.IdMetadataGenerator.addIdProperties(IdMetadataGenerator.java:71)
>     at org.hibernate.envers.configuration.metadata.IdMetadataGenerator.addId(IdMetadataGenerator.java:107)
>     at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:380)
>     at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:102)
>     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:315)
>     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)
>     ... 173 more
>  
> I'm trying to add relationships like below.  This relationship, without the targetAuditMode parameter, worked successfully in 1.2.1.  SomeEntity was not audited in 1.2.1 and was a static dictionary object, so I didn't have to worry about an Audit join table or an audit table for SomeEntity.  The column would be correctly filled in the audit table.  However, under 1.2.2 the same code does not deploy.
>  
>     @ManyToOne( fetch = FetchType.LAZY )
>     @JoinColumn( name="SOME_ID", nullable=true )
>     @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
>     private SomeEntity       someEntity;
> Per Adam Warski's reply, this is due to a non-Audited entity with @ManyToOne in the PK.  This type of entity does exist in my project. 

-- 
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