HHH-9199 - Fixed auditing of embeddable collections using ValidityAuditStrategy.

(cherry picked from commit a17dd125e7)

Conflicts:
	hibernate-envers/src/main/java/org/hibernate/envers/strategy/ValidityAuditStrategy.java

(cherry picked from commit 815a0a81c2)
This commit is contained in:
Chris Cranford 2016-07-12 14:17:02 -05:00 committed by Gail Badner
parent e033f028c2
commit d1176ce72e
1 changed files with 4 additions and 1 deletions

View File

@ -246,10 +246,13 @@ public class ValidityAuditStrategy implements AuditStrategy {
);
final String revisionFieldName = enversService.getAuditEntitiesConfiguration().getRevisionFieldName();
final String revisionTypePropName = enversService.getAuditEntitiesConfiguration().getRevisionTypePropName();
final String ordinalPropName = enversService.getAuditEntitiesConfiguration().getEmbeddableSetOrdinalPropertyName();
// Adding a parameter for each id component, except the rev number and type.
for ( Map.Entry<String, Object> 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()