From a17dd125e710d7e133df0489090e14cfeb243171 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Tue, 12 Jul 2016 14:17:02 -0500 Subject: [PATCH] HHH-9199 - Fixed auditing of embeddable collections using ValidityAuditStrategy. --- .../org/hibernate/envers/strategy/ValidityAuditStrategy.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/strategy/ValidityAuditStrategy.java b/hibernate-envers/src/main/java/org/hibernate/envers/strategy/ValidityAuditStrategy.java index 89d49c1984..cadfebcbc3 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/strategy/ValidityAuditStrategy.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/strategy/ValidityAuditStrategy.java @@ -246,10 +246,13 @@ public class ValidityAuditStrategy implements AuditStrategy { ); final String revisionFieldName = auditEntitiesConfiguration.getRevisionFieldName(); final String revisionTypePropName = auditEntitiesConfiguration.getRevisionTypePropName(); + final String ordinalPropName = auditEntitiesConfiguration.getEmbeddableSetOrdinalPropertyName(); // Adding a parameter for each id component, except the rev number and type. for ( Map.Entry originalIdEntry : originalId.entrySet() ) { - if ( !revisionFieldName.equals( originalIdEntry.getKey() ) && !revisionTypePropName.equals( originalIdEntry.getKey() ) ) { + if ( !revisionFieldName.equals( originalIdEntry.getKey() ) + && !revisionTypePropName.equals( originalIdEntry.getKey() ) + && !ordinalPropName.equals( originalIdEntry.getKey() ) ) { qb.getRootParameters().addWhereWithParam( originalIdPropName + "." + originalIdEntry.getKey(), true, "=", originalIdEntry.getValue()