eliminate dupe log message

This commit is contained in:
Gavin King 2024-10-07 19:05:58 +02:00
parent c92c2f5f21
commit c18b7c90fe
1 changed files with 11 additions and 12 deletions

View File

@ -13,8 +13,9 @@ import org.hibernate.boot.Metadata;
import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.boot.spi.MetadataBuildingContext;
import org.hibernate.internal.CoreLogging; import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.internal.util.ReflectHelper;
import static org.hibernate.internal.util.ReflectHelper.overridesEquals;
import static org.hibernate.internal.util.ReflectHelper.overridesHashCode;
import static org.hibernate.internal.util.StringHelper.nullIfEmpty; import static org.hibernate.internal.util.StringHelper.nullIfEmpty;
/** /**
@ -325,17 +326,15 @@ public class RootClass extends PersistentClass implements TableOwner, SoftDeleta
* <em>correct</em>) we simply log a warning. * <em>correct</em>) we simply log a warning.
*/ */
private void checkCompositeIdentifier() { private void checkCompositeIdentifier() {
if ( getIdentifier() instanceof Component id ) { if ( getIdentifier() instanceof Component id
if ( !id.isDynamic() ) { && !id.isDynamic() ) {
final Class<?> idClass = id.getComponentClass(); final Class<?> idClass = id.getComponentClass();
if ( idClass != null ) { if ( idClass != null ) {
final String idComponentClassName = idClass.getName(); if ( !overridesEquals( idClass ) ) {
if ( !ReflectHelper.overridesEquals( idClass ) ) { LOG.compositeIdClassDoesNotOverrideEquals( idClass.getName() );
LOG.compositeIdClassDoesNotOverrideEquals( idComponentClassName ); }
} else if ( !overridesHashCode( idClass ) ) {
if ( !ReflectHelper.overridesHashCode( idClass ) ) { LOG.compositeIdClassDoesNotOverrideHashCode( idClass.getName() );
LOG.compositeIdClassDoesNotOverrideHashCode( idComponentClassName );
}
} }
} }
} }