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