HHH-16340 Avoid checking discriminator duplication when not insertable

This commit is contained in:
Marco Belladelli 2023-03-24 10:15:33 +01:00
parent 1394659ff3
commit 0da73a27a5
1 changed files with 3 additions and 1 deletions

View File

@ -1103,7 +1103,9 @@ public abstract class PersistentClass implements AttributeContainer, Serializabl
//and checked later, so it needs to be excluded //and checked later, so it needs to be excluded
checkColumnDuplication( cols, getKey() ); checkColumnDuplication( cols, getKey() );
} }
checkColumnDuplication( cols, getDiscriminator() ); if ( isDiscriminatorInsertable() ) {
checkColumnDuplication( cols, getDiscriminator() );
}
checkPropertyColumnDuplication( cols, getNonDuplicatedProperties() ); checkPropertyColumnDuplication( cols, getNonDuplicatedProperties() );
for ( Join join : getJoins() ) { for ( Join join : getJoins() ) {
cols.clear(); cols.clear();