diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ClassPropertyHolder.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ClassPropertyHolder.java index 4098087c9c..9abb4ea005 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ClassPropertyHolder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ClassPropertyHolder.java @@ -271,9 +271,13 @@ public class ClassPropertyHolder extends AbstractPropertyHolder { } } - private void addPropertyToMappedSuperclass(Property prop, MemberDetails memberDetails, ClassDetails declaringClass) { - final MappedSuperclass superclass = getContext().getMetadataCollector().getMappedSuperclass( declaringClass.toJavaClass() ); - prepareActualProperty( prop, memberDetails, true, getContext(), superclass::addDeclaredProperty ); + public static void addPropertyToMappedSuperclass( + Property prop, + MemberDetails memberDetails, + ClassDetails declaringClass, + MetadataBuildingContext context) { + final MappedSuperclass superclass = context.getMetadataCollector().getMappedSuperclass( declaringClass.toJavaClass() ); + prepareActualProperty( prop, memberDetails, true, context, superclass::addDeclaredProperty ); } static void prepareActualProperty( diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ComponentPropertyHolder.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ComponentPropertyHolder.java index 60022206dd..2a5ad1eeef 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ComponentPropertyHolder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ComponentPropertyHolder.java @@ -32,8 +32,6 @@ import jakarta.persistence.JoinTable; import static org.hibernate.boot.model.internal.ClassPropertyHolder.addPropertyToMappedSuperclass; import static org.hibernate.boot.model.internal.ClassPropertyHolder.handleGenericComponentProperty; -import static org.hibernate.boot.model.internal.HCANNHelper.hasAnnotation; -import static org.hibernate.internal.util.NullnessUtil.castNonNull; import static org.hibernate.internal.util.StringHelper.isEmpty; import static org.hibernate.internal.util.StringHelper.qualifyConditionally; import static org.hibernate.spi.NavigablePath.IDENTIFIER_MAPPER_PROPERTY; @@ -70,7 +68,7 @@ public class ComponentPropertyHolder extends AbstractPropertyHolder { private final Component component; private final boolean isOrWithinEmbeddedId; private final boolean isWithinElementCollection; - private final Map inheritanceStatePerClass; + private final Map inheritanceStatePerClass; private final String embeddedAttributeName; private final Map attributeConversionInfoMap; @@ -81,7 +79,7 @@ public class ComponentPropertyHolder extends AbstractPropertyHolder { PropertyData inferredData, PropertyHolder parent, MetadataBuildingContext context, - Map inheritanceStatePerClass) { + Map inheritanceStatePerClass) { super( path, parent, inferredData.getPropertyType().determineRawClass(), context ); final MemberDetails embeddedMemberDetails = inferredData.getAttributeMember(); setCurrentProperty( embeddedMemberDetails ); @@ -292,11 +290,11 @@ public class ComponentPropertyHolder extends AbstractPropertyHolder { @Override public void addProperty(Property prop, MemberDetails attributeMemberDetails, ClassDetails declaringClass) { - handleGenericComponentProperty( prop, getContext() ); + handleGenericComponentProperty( prop, attributeMemberDetails, getContext() ); if ( declaringClass != null ) { final InheritanceState inheritanceState = inheritanceStatePerClass.get( declaringClass ); if ( inheritanceState != null && inheritanceState.isEmbeddableSuperclass() ) { - addPropertyToMappedSuperclass( prop, declaringClass, getContext() ); + addPropertyToMappedSuperclass( prop, attributeMemberDetails, declaringClass, getContext() ); } } component.addProperty( prop, declaringClass ); diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/InheritanceState.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/InheritanceState.java index 4048feec29..b486576a3f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/InheritanceState.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/InheritanceState.java @@ -17,7 +17,6 @@ import org.hibernate.boot.spi.PropertyData; import org.hibernate.mapping.Component; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Table; -import org.hibernate.models.spi.AnnotationUsage; import org.hibernate.models.spi.ClassDetails; import org.hibernate.models.spi.FieldDetails; import org.hibernate.models.spi.MethodDetails; diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/PropertyHolderBuilder.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/PropertyHolderBuilder.java index 851b2856f8..2403897c00 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/PropertyHolderBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/PropertyHolderBuilder.java @@ -55,7 +55,7 @@ public final class PropertyHolderBuilder { PropertyData inferredData, PropertyHolder parent, MetadataBuildingContext context, - Map inheritanceStatePerClass) { + Map inheritanceStatePerClass) { return new ComponentPropertyHolder( component, path, inferredData, parent, context, inheritanceStatePerClass ); } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/AbstractSqmSelectionQuery.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/AbstractSqmSelectionQuery.java index 7d7783cc14..628f9dfad3 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/AbstractSqmSelectionQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/AbstractSqmSelectionQuery.java @@ -280,8 +280,8 @@ abstract class AbstractSqmSelectionQuery extends AbstractSelectionQuery { return buildConcreteQueryPlan( sqmStatement, null, null, options ); } - protected void applyOptions(NamedSqmQueryMemento memento) { - applyOptions( (NamedQueryMemento) memento ); + protected void applyOptions(NamedSqmQueryMemento memento) { + applyOptions( (NamedQueryMemento) memento ); if ( memento.getFirstResult() != null ) { setFirstResult( memento.getFirstResult() );