HHH-14623 Do not try to audit non-insertable, non-updateable component properties

This commit is contained in:
mgtriffid 2020-10-20 15:04:58 +07:00
parent 4859be84c1
commit 0ee23ce116
2 changed files with 5 additions and 5 deletions

View File

@ -343,7 +343,10 @@ public final class AuditMetadataGenerator {
// Verifies if a mapping exists using a @JoinColumn against a @NaturalId field
// and if so, this eliminates the mapping property as it isn't needed.
if ( property instanceof SyntheticProperty ) {
if ( property.getValue().isAlternateUniqueKey() ) {
if ( property.getValue().isAlternateUniqueKey() ||
// HHH-14263
// If synthetic property is non-insertable, non-updatable, then no need to audit it
!(property.isInsertable() || property.isUpdateable()) ) {
continue;
}
}

View File

@ -263,10 +263,7 @@ public class AuditedPropertiesReader {
final Property property = propertyIter.next();
addPersistentProperty( property );
// See HHH-6636
if ( "embedded".equals( property.getPropertyAccessorName() )
&& !PropertyPath.IDENTIFIER_MAPPER_PROPERTY.equals( property.getName() )
&& (property.isInsertable() || property.isUpdateable())
) {
if ( "embedded".equals( property.getPropertyAccessorName() ) && !PropertyPath.IDENTIFIER_MAPPER_PROPERTY.equals( property.getName() ) ) {
createPropertiesGroupMapping( property );
}
}