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

This commit is contained in:
Chris Cranford 2016-07-12 14:17:02 -05:00
parent 95c01d9001
commit a17dd125e7
1 changed files with 4 additions and 1 deletions

View File

@ -246,10 +246,13 @@ public class ValidityAuditStrategy implements AuditStrategy {
); );
final String revisionFieldName = auditEntitiesConfiguration.getRevisionFieldName(); final String revisionFieldName = auditEntitiesConfiguration.getRevisionFieldName();
final String revisionTypePropName = auditEntitiesConfiguration.getRevisionTypePropName(); final String revisionTypePropName = auditEntitiesConfiguration.getRevisionTypePropName();
final String ordinalPropName = auditEntitiesConfiguration.getEmbeddableSetOrdinalPropertyName();
// Adding a parameter for each id component, except the rev number and type. // Adding a parameter for each id component, except the rev number and type.
for ( Map.Entry<String, Object> originalIdEntry : originalId.entrySet() ) { 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( qb.getRootParameters().addWhereWithParam(
originalIdPropName + "." + originalIdEntry.getKey(), originalIdPropName + "." + originalIdEntry.getKey(),
true, "=", originalIdEntry.getValue() true, "=", originalIdEntry.getValue()