Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ private static <T> BasicValue.Resolution<T> createResolution(

// support for AttributeConverter would be nice too
if ( isKnownType ) {
final T typeInstance = instantiateType( bootstrapContext.getServiceRegistry(),
context.getBuildingOptions(), name, typeImplementorClass, instanceProducer );
final T typeInstance =
instantiateType( bootstrapContext.getServiceRegistry(), context.getBuildingOptions(),
name, typeImplementorClass, instanceProducer );

if ( typeInstance instanceof TypeConfigurationAware ) {
final TypeConfigurationAware configurationAware = (TypeConfigurationAware) typeInstance;
if ( typeInstance instanceof TypeConfigurationAware configurationAware ) {
configurationAware.setTypeConfiguration( typeConfiguration );
}

Expand Down Expand Up @@ -332,11 +332,10 @@ public boolean equals(Object o) {
if ( this == o ) {
return true;
}
if ( !( o instanceof TypeDefinition ) ) {
if ( !(o instanceof TypeDefinition that) ) {
return false;
}

final TypeDefinition that = (TypeDefinition) o;
return Objects.equals( this.name, that.name )
&& Objects.equals( this.typeImplementorClass, that.typeImplementorClass )
&& Arrays.equals( this.registrationKeys, that.registrationKeys )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ public AbstractConverterDescriptor(
}

private AutoApplicableConverterDescriptor resolveAutoApplicableDescriptor(
Class<? extends AttributeConverter> converterClass,
Class<? extends AttributeConverter<?,?>> converterClass,
Boolean forceAutoApply) {
final boolean autoApply;

if ( forceAutoApply != null ) {
// if the caller explicitly specified whether to auto-apply, honor that
autoApply = forceAutoApply;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.hibernate.boot.models.JpaAnnotations;
import org.hibernate.boot.models.annotations.internal.ColumnJpaAnnotation;
import org.hibernate.boot.spi.MetadataBuildingContext;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.models.spi.AnnotationTarget;
import org.hibernate.models.spi.ClassDetails;
Expand All @@ -30,8 +29,6 @@
import org.hibernate.usertype.internal.AbstractTimeZoneStorageCompositeUserType;
import org.hibernate.usertype.internal.OffsetTimeCompositeUserType;

import org.jboss.logging.Logger;

import jakarta.persistence.AssociationOverride;
import jakarta.persistence.AttributeOverride;
import jakarta.persistence.Column;
Expand All @@ -53,7 +50,6 @@
* @author Emmanuel Bernard
*/
public abstract class AbstractPropertyHolder implements PropertyHolder {
private static final Logger log = CoreLogging.logger( AbstractPropertyHolder.class );

private final String path;
protected final AbstractPropertyHolder parent;
Expand Down Expand Up @@ -106,8 +102,6 @@ public ConverterDescriptor resolveAttributeConverterDescriptor(MemberDetails att
}
}

log.debugf( "Attempting to locate auto-apply AttributeConverter for attributeMember [%s:%s]", path, attributeMember.getName() );

return context.getMetadataCollector()
.getConverterRegistry()
.getAttributeConverterAutoApplyHandler()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
package org.hibernate.boot.model.internal;

import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -39,11 +38,10 @@
import org.hibernate.models.spi.MemberDetails;
import org.hibernate.models.spi.SourceModelBuildingContext;

import org.jboss.logging.Logger;

import static org.hibernate.boot.model.internal.BinderHelper.getPath;
import static org.hibernate.boot.model.internal.BinderHelper.getRelativePath;
import static org.hibernate.boot.model.internal.DialectOverridesAnnotationHelper.getOverridableAnnotation;
import static org.hibernate.internal.CoreLogging.messageLogger;
import static org.hibernate.internal.util.StringHelper.isBlank;
import static org.hibernate.internal.util.StringHelper.isEmpty;
import static org.hibernate.internal.util.StringHelper.isNotEmpty;
Expand All @@ -69,7 +67,7 @@
*/
public class AnnotatedColumn {

private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, AnnotatedColumn.class.getName() );
private static final CoreMessageLogger LOG = messageLogger( AnnotatedColumn.class );

private Column mappingColumn;
private boolean insertable = true;
Expand Down Expand Up @@ -244,7 +242,9 @@ public AnnotatedColumn() {

public void bind() {
if ( isNotEmpty( formulaString ) ) {
LOG.debugf( "Binding formula %s", formulaString );
if ( LOG.isDebugEnabled() ) {
LOG.debug( "Binding formula: " + formulaString );
}
formula = new Formula();
formula.setFormula( formulaString );
}
Expand Down Expand Up @@ -277,7 +277,7 @@ public void bind() {
mappingColumn.setGeneratedAs( generatedAs );
}
if ( LOG.isDebugEnabled() ) {
LOG.debugf( "Binding column: %s", toString() );
LOG.debug( "Binding column: " + logicalColumnName );
}
}
}
Expand Down Expand Up @@ -709,7 +709,9 @@ private static jakarta.persistence.Column[] overrideColumns(
+ " '@AttributeOverride's but the overridden property has " + overriddenCols.length
+ " columns (every column must have exactly one '@AttributeOverride')" );
}
LOG.debugf( "Column(s) overridden for property %s", inferredData.getPropertyName() );
if ( LOG.isDebugEnabled() ) {
LOG.debug( "Column mapping overridden for property: " + inferredData.getPropertyName() );
}
return isEmpty( overriddenCols ) ? null : overriddenCols;
}
else {
Expand Down Expand Up @@ -1020,14 +1022,11 @@ private static AnnotatedColumns buildImplicitColumn(
public String toString() {
final StringBuilder string = new StringBuilder();
string.append( getClass().getSimpleName() ).append( "(" );
if ( isNotEmpty( logicalColumnName ) ) {
string.append( "column='" ).append( logicalColumnName ).append( "'," );
}
if ( isNotEmpty( formulaString ) ) {
string.append( "formula='" ).append( formulaString ).append( "'," );
string.append( "formula='" ).append( formulaString );
}
if ( string.charAt( string.length()-1 ) == ',' ) {
string.setLength( string.length()-1 );
else if ( isNotEmpty( logicalColumnName ) ) {
string.append( "column='" ).append( logicalColumnName );
}
string.append( ")" );
return string.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

import static org.hibernate.boot.model.internal.AnnotatedClassType.EMBEDDABLE;
import static org.hibernate.boot.model.internal.AnnotatedClassType.ENTITY;
import static org.hibernate.boot.model.internal.EntityBinder.bindEntityClass;
import static org.hibernate.boot.model.internal.FilterDefBinder.bindFilterDefs;
import static org.hibernate.boot.model.internal.GeneratorParameters.interpretSequenceGenerator;
import static org.hibernate.boot.model.internal.GeneratorParameters.interpretTableGenerator;
Expand Down Expand Up @@ -79,7 +80,7 @@ public static void bindDefaults(MetadataBuildingContext context) {
interpretSequenceGenerator( generatorRegistration.configuration(), definitionBuilder );
final IdentifierGeneratorDefinition idGenDef = definitionBuilder.build();
if ( LOG.isTraceEnabled() ) {
LOG.tracef( "Adding global sequence generator with name: %s", name );
LOG.trace( "Adding global sequence generator with name: " + name );
}
context.getMetadataCollector().addDefaultIdentifierGenerator( idGenDef );
} );
Expand All @@ -89,7 +90,7 @@ public static void bindDefaults(MetadataBuildingContext context) {
interpretTableGenerator( generatorRegistration.configuration(), definitionBuilder );
final IdentifierGeneratorDefinition idGenDef = definitionBuilder.build();
if ( LOG.isTraceEnabled() ) {
LOG.tracef( "Adding global table generator with name: %s", name );
LOG.trace( "Adding global table generator with name: " + name );
}
context.getMetadataCollector().addDefaultIdentifierGenerator( idGenDef );
} );
Expand Down Expand Up @@ -217,7 +218,7 @@ public static void bindClass(
// try to find class level generators
// GeneratorBinder.registerGlobalGenerators( classDetails, context );
if ( context.getMetadataCollector().getClassType( classDetails ) == ENTITY ) {
EntityBinder.bindEntityClass( classDetails, inheritanceStatePerClass, context );
bindEntityClass( classDetails, inheritanceStatePerClass, context );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public ArrayBinder(
super( customTypeBeanResolver, buildingContext );
}

@Override
protected Collection createCollection(PersistentClass owner) {
return new Array( getCustomTypeBeanResolver(), owner, getBuildingContext() );
}
Expand Down
Loading
Loading