expressable -> expressible everywhere

This commit is contained in:
Gavin King 2022-01-23 16:32:43 +01:00
parent 23324318fd
commit 3c77ab5f69
187 changed files with 963 additions and 962 deletions

View File

@ -5,7 +5,7 @@ no references to tables, columns, etc. The base contract for Hibernate's extens
JPA model is `org.hibernate.metamodel.model.domain.DomainType`.
Hibernate's Semantic Query Model (SQM) is defined in terms of these JPA type extensions,
through the `org.hibernate.query.sqm.SqmExpressable` contract, allowing parts of the application's
through the `SqmExpressible` contract, allowing parts of the application's
domain model to be used as part of an SQM tree.
@ -25,7 +25,7 @@ interface IdentifiableDomainType
interface EntityDomainType
interface MappedSuperclassDomainType
interface SqmExpressable
interface SqmExpressible
interface SqmPathSource
interface PersistentAttribute
interface SingularPersistentAttribute
@ -40,8 +40,8 @@ ManagedDomainType <|-- IdentifiableDomainType
IdentifiableDomainType <|-- MappedSuperclassDomainType
IdentifiableDomainType <|-- EntityDomainType
SqmExpressable <|-- DomainType
SqmExpressable <|-- SqmPathSource
SqmExpressible <|-- DomainType
SqmExpressible <|-- SqmPathSource
SqmPathSource <|-- EntityDomainType
SqmPathSource <|-- PersistentAttribute

View File

@ -18,7 +18,7 @@ skinparam handwritten true
interface MappingType
interface ManagedMappingType
interface MappingModelExpressable
interface MappingModelExpressible
interface ValueMapping
interface BasicType
interface ModelPart
@ -32,8 +32,8 @@ MappingType <|-- CollectionMappingType
ManagedMappingType <|-- EmbeddableMappingType
ManagedMappingType <|-- EntityMappingType
MappingModelExpressable <|-- ValueMapping
MappingModelExpressable <|-- ModelPart
MappingModelExpressible <|-- ValueMapping
MappingModelExpressible <|-- ModelPart
ValueMapping <|-- BasicType
@ -68,5 +68,5 @@ EntityIdentifierMapping::EntityIdentifierDefinition
AT some point this needs to be "resolved" to a ValueMapping/Type/Bindable when generating the SQL AST and executing.
One option is to have the `BindableType` be resolved first to a `SqmExpressable`
`SqmExpressableAllowableParameterType#resolveSqmExpressable`
One option is to have the `BindableType` be resolved first to a `SqmExpressible`
`SqmExpressibleAllowableParameterType#resolveSqmExpressible`

View File

@ -109,7 +109,7 @@ import org.hibernate.mapping.Index;
import org.hibernate.mapping.Table;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.SqlExpressable;
import org.hibernate.metamodel.mapping.SqlExpressible;
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
import org.hibernate.persister.entity.Lockable;
import org.hibernate.procedure.internal.StandardCallableStatementSupport;
@ -1421,12 +1421,12 @@ public abstract class Dialect implements ConversionContext {
/**
* Get the name of the database type appropriate for casting operations
* (via the CAST() SQL function) for the given {@link SqlExpressable}
* (via the CAST() SQL function) for the given {@link SqlExpressible}
* SQL type.
*
* @return The database type name
*/
public String getCastTypeName(SqlExpressable type, Long length, Integer precision, Integer scale) {
public String getCastTypeName(SqlExpressible type, Long length, Integer precision, Integer scale) {
final JdbcMapping jdbcMapping = type.getJdbcMapping();
final JdbcType jdbcType = jdbcMapping.getJdbcType();
final JavaType<?> javaType = jdbcMapping.getJavaTypeDescriptor();

View File

@ -44,7 +44,7 @@ import org.hibernate.exception.spi.ViolatedConstraintNameExtractor;
import org.hibernate.internal.util.JdbcExceptionHelper;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.SqlExpressable;
import org.hibernate.metamodel.mapping.SqlExpressible;
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
import org.hibernate.query.sqm.CastType;
import org.hibernate.query.sqm.IntervalType;
@ -806,7 +806,7 @@ public class MySQLDialect extends Dialect {
}
@Override
public String getCastTypeName(SqlExpressable type, Long length, Integer precision, Integer scale) {
public String getCastTypeName(SqlExpressible type, Long length, Integer precision, Integer scale) {
final JdbcMapping jdbcMapping = type.getJdbcMapping();
final JdbcType jdbcType = jdbcMapping.getJdbcType();
final JavaType<?> javaType = jdbcMapping.getJavaTypeDescriptor();

View File

@ -32,7 +32,7 @@ import org.hibernate.mapping.Constraint;
import org.hibernate.mapping.ForeignKey;
import org.hibernate.mapping.Table;
import org.hibernate.mapping.UniqueKey;
import org.hibernate.metamodel.mapping.SqlExpressable;
import org.hibernate.metamodel.mapping.SqlExpressible;
import org.hibernate.persister.entity.Lockable;
import org.hibernate.query.sqm.IntervalType;
import org.hibernate.query.SemanticException;
@ -799,7 +799,7 @@ public class SpannerDialect extends Dialect {
/* Type conversion and casting */
@Override
public String getCastTypeName(SqlExpressable type, Long length, Integer precision, Integer scale) {
public String getCastTypeName(SqlExpressible type, Long length, Integer precision, Integer scale) {
//Spanner doesn't let you specify a length in cast() types
return super.getRawTypeName( type.getJdbcMapping().getJdbcType() );
}

View File

@ -128,7 +128,7 @@ public class TimestampaddFunction
? BinaryArithmeticOperator.MULTIPLY
: BinaryArithmeticOperator.DIVIDE,
new QueryLiteral<>(
expressionType.getExpressableJavaType()
expressionType.getExpressibleJavaType()
.fromString( conversionFactor.substring( 1 ) ),
expressionType
),

View File

@ -12,26 +12,26 @@ import java.util.function.Function;
import org.hibernate.Incubating;
import org.hibernate.graph.RootGraph;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.BindableType;
import org.hibernate.metamodel.model.domain.EntityDomainType;
import org.hibernate.metamodel.model.domain.NavigableRole;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.query.spi.NavigablePath;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.sql.ast.tree.from.TableGroup;
import org.hibernate.type.spi.TypeConfiguration;
/**
* Access to information about Hibernate's runtime relational mapping model
* Access to information about the runtime relational O/R mapping model
*
* @author Steve Ebersole
*/
@Incubating
public interface MappingMetamodel {
/**
* The TypeConfiguration this metamodel is associated with
* The {@link TypeConfiguration} this metamodel is associated with
*/
TypeConfiguration getTypeConfiguration();
@ -41,8 +41,14 @@ public interface MappingMetamodel {
/**
* todo (6.0) : POC!!! Intended for use in SQM -> SQL translation
*/
MappingModelExpressable<?> resolveMappingExpressable(SqmExpressable<?> sqmExpressable, Function<NavigablePath, TableGroup> tableGroupLocator);
MappingModelExpressable<?> lenientlyResolveMappingExpressable(SqmExpressable<?> sqmExpressable, Function<NavigablePath, TableGroup> tableGroupLocator);
MappingModelExpressible<?> resolveMappingExpressible(
SqmExpressible<?> sqmExpressible,
Function<NavigablePath,
TableGroup> tableGroupLocator);
MappingModelExpressible<?> lenientlyResolveMappingExpressible(
SqmExpressible<?> sqmExpressible,
Function<NavigablePath, TableGroup> tableGroupLocator);
/**
* Given a Java type, determine the corresponding BindableType to

View File

@ -20,7 +20,7 @@ import java.util.List;
*
* @author Steve Ebersole
*/
public interface BasicValuedMapping extends ValueMapping, SqlExpressable {
public interface BasicValuedMapping extends ValueMapping, SqlExpressible {
@Override
default int getJdbcTypeCount() {
return 1;

View File

@ -7,12 +7,12 @@
package org.hibernate.metamodel.mapping;
import org.hibernate.sql.results.graph.Fetchable;
import org.hibernate.type.descriptor.java.JavaTypedExpressable;
import org.hibernate.type.descriptor.java.JavaTypedExpressible;
/**
* @author Steve Ebersole
*/
public interface CollectionPart extends ModelPart, Fetchable, JavaTypedExpressable {
public interface CollectionPart extends ModelPart, Fetchable, JavaTypedExpressible {
enum Nature {
ELEMENT( "{element}" ),
INDEX( "{index}" ),

View File

@ -24,13 +24,13 @@ import org.hibernate.type.descriptor.jdbc.JdbcType;
public interface JdbcMapping extends MappingType, JdbcMappingContainer {
/**
* The descriptor for the Java type represented by this
* expressable type
* expressible type
*/
JavaType getJavaTypeDescriptor();
/**
* The descriptor for the SQL type represented by this
* expressable type
* expressible type
*/
JdbcType getJdbcType();
@ -39,19 +39,19 @@ public interface JdbcMapping extends MappingType, JdbcMappingContainer {
}
/**
* The strategy for extracting values of this expressable
* The strategy for extracting values of this expressible
* type from JDBC ResultSets, CallableStatements, etc
*/
ValueExtractor getJdbcValueExtractor();
ValueExtractor<?> getJdbcValueExtractor();
/**
* The strategy for binding values of this expressable
* type to JDBC PreparedStatements, CallableStatements, etc
* The strategy for binding values of this expressible type to
* JDBC {@code PreparedStatement}s and {@code CallableStatement}s.
*/
ValueBinder getJdbcValueBinder();
@Override
default JavaType getMappedJavaType() {
default JavaType<?> getMappedJavaType() {
return getJavaTypeDescriptor();
}

View File

@ -7,7 +7,7 @@
package org.hibernate.metamodel.mapping;
/**
* Something that can be expressable at the mapping model level.
* Something that can be expressible at the mapping model level.
*
* Generally this is used generation of SQL AST
*
@ -16,5 +16,5 @@ package org.hibernate.metamodel.mapping;
* @author Steve Ebersole
* @author Andrea Boriero
*/
public interface MappingModelExpressable<T> extends Bindable {
public interface MappingModelExpressible<T> extends Bindable {
}

View File

@ -28,7 +28,7 @@ import org.hibernate.type.descriptor.java.JavaType;
*
* @author Steve Ebersole
*/
public interface ModelPart extends MappingModelExpressable {
public interface ModelPart extends MappingModelExpressible {
MappingType getPartMappingType();
JavaType<?> getJavaType();

View File

@ -14,9 +14,9 @@ package org.hibernate.metamodel.mapping;
*
* @author Steve Ebersole
*/
public interface SqlExpressable extends JdbcMappingContainer {
public interface SqlExpressible extends JdbcMappingContainer {
/**
* Any thing that is expressable at the SQL AST level
* Anything that is expressible at the SQL AST level
* would be of basic type.
*/
JdbcMapping getJdbcMapping();

View File

@ -9,7 +9,7 @@ package org.hibernate.metamodel.mapping;
import java.util.Locale;
import org.hibernate.type.descriptor.java.JavaType;
import org.hibernate.type.descriptor.java.JavaTypedExpressable;
import org.hibernate.type.descriptor.java.JavaTypedExpressible;
/**
* Describes a mapping related to any part of the app's domain model - e.g.
@ -21,14 +21,14 @@ import org.hibernate.type.descriptor.java.JavaTypedExpressable;
*
* @author Steve Ebersole
*/
public interface ValueMapping extends MappingModelExpressable, JavaTypedExpressable {
public interface ValueMapping extends MappingModelExpressible, JavaTypedExpressible {
/**
* Descriptor for the type of this mapping
*/
MappingType getMappedType();
@Override
default JavaType<?> getExpressableJavaType() {
default JavaType<?> getExpressibleJavaType() {
return getMappedType().getMappedJavaType();
}

View File

@ -264,7 +264,7 @@ public class BasicEntityIdentifierMappingImpl implements BasicEntityIdentifierMa
return expressionResolver.resolveSqlSelection(
expression,
idType.getExpressableJavaType(),
idType.getExpressibleJavaType(),
sessionFactory.getTypeConfiguration()
);
}

View File

@ -173,7 +173,7 @@ public class DiscriminatedCollectionPart implements DiscriminatedAssociationMode
}
@Override
public JavaType<?> getExpressableJavaType() {
public JavaType<?> getExpressibleJavaType() {
return getJavaType();
}

View File

@ -302,7 +302,7 @@ public class EmbeddedCollectionPart implements CollectionPart, EmbeddableValuedF
}
@Override
public JavaType<?> getExpressableJavaType() {
public JavaType<?> getExpressibleJavaType() {
return getJavaType();
}

View File

@ -380,7 +380,7 @@ public class EntityCollectionPart
}
@Override
public JavaType<?> getExpressableJavaType() {
public JavaType<?> getExpressibleJavaType() {
return getJavaType();
}

View File

@ -159,7 +159,7 @@ public class IdClassEmbeddable extends AbstractEmbeddableMapping implements Iden
if ( o == null ) {
final AttributeMapping idClassAttributeMapping = idClassAttribute.get( i );
if ( idClassAttributeMapping.getPropertyAccess().getGetter().getReturnTypeClass().isPrimitive() ) {
propertyValues[i] = idClassAttributeMapping.getExpressableJavaType().getDefaultValue();
propertyValues[i] = idClassAttributeMapping.getExpressibleJavaType().getDefaultValue();
}
else {
propertyValues[i] = null;

View File

@ -216,7 +216,7 @@ public class NonAggregatedIdentifierMappingImpl extends AbstractCompositeIdentif
if ( o == null ) {
final AttributeMapping idClassAttributeMapping = idClassAttributeMappings.get( i );
if ( idClassAttributeMapping.getPropertyAccess().getGetter().getReturnTypeClass().isPrimitive() ) {
propertyValues[i] = idClassAttributeMapping.getExpressableJavaType().getDefaultValue();
propertyValues[i] = idClassAttributeMapping.getExpressibleJavaType().getDefaultValue();
}
else {
propertyValues[i] = null;

View File

@ -25,13 +25,13 @@ public abstract class AbstractDomainType<J> implements SimpleDomainType<J> {
}
@Override
public JavaType<J> getExpressableJavaType() {
public JavaType<J> getExpressibleJavaType() {
return javaType;
}
@Override
public Class<J> getJavaType() {
return this.getExpressableJavaType().getJavaTypeClass();
return this.getExpressibleJavaType().getJavaTypeClass();
}
@Override

View File

@ -12,7 +12,7 @@ import jakarta.persistence.metamodel.BasicType;
import org.hibernate.HibernateException;
import org.hibernate.query.ReturnableType;
import org.hibernate.query.OutputableType;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
/**
* Hibernate extension to the JPA {@link BasicType} contract.
@ -20,7 +20,7 @@ import org.hibernate.query.sqm.SqmExpressable;
* @author Steve Ebersole
*/
public interface BasicDomainType<J>
extends SimpleDomainType<J>, BasicType<J>, SqmExpressable<J>, OutputableType<J>, ReturnableType<J> {
extends SimpleDomainType<J>, BasicType<J>, SqmExpressible<J>, OutputableType<J>, ReturnableType<J> {
@Override
default PersistenceType getPersistenceType() {
return PersistenceType.BASIC;

View File

@ -6,7 +6,7 @@
*/
package org.hibernate.metamodel.model.domain;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.type.descriptor.java.JavaType;
/**
@ -25,7 +25,7 @@ import org.hibernate.type.descriptor.java.JavaType;
*
* @author Steve Ebersole
*/
public interface DomainType<J> extends SqmExpressable<J> {
public interface DomainType<J> extends SqmExpressible<J> {
/**
* The name of the type.
*
@ -35,7 +35,7 @@ public interface DomainType<J> extends SqmExpressable<J> {
*/
default String getTypeName() {
// default impl to handle the general case returning the Java type name
return getExpressableJavaType().getJavaType().getTypeName();
return getExpressibleJavaType().getJavaType().getTypeName();
}
/**
@ -44,5 +44,5 @@ public interface DomainType<J> extends SqmExpressable<J> {
*
* @see #getTypeName
*/
JavaType<J> getExpressableJavaType();
JavaType<J> getExpressibleJavaType();
}

View File

@ -7,7 +7,7 @@
package org.hibernate.metamodel.model.domain;
import org.hibernate.query.BindableType;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import jakarta.persistence.metamodel.EmbeddableType;
@ -20,5 +20,5 @@ import jakarta.persistence.metamodel.EmbeddableType;
* @author Steve Ebersole
*/
public interface EmbeddableDomainType<J>
extends ManagedDomainType<J>, EmbeddableType<J>, BindableType<J>, SqmExpressable<J> {
extends ManagedDomainType<J>, EmbeddableType<J>, BindableType<J>, SqmExpressible<J> {
}

View File

@ -10,7 +10,7 @@ import java.util.function.Consumer;
import org.hibernate.graph.spi.SubGraphImplementor;
import org.hibernate.metamodel.RepresentationMode;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import jakarta.persistence.metamodel.ManagedType;
@ -19,7 +19,7 @@ import jakarta.persistence.metamodel.ManagedType;
*
* @author Steve Ebersole
*/
public interface ManagedDomainType<J> extends SqmExpressable<J>, DomainType<J>, ManagedType<J> {
public interface ManagedDomainType<J> extends SqmExpressible<J>, DomainType<J>, ManagedType<J> {
/**
* Get the type name.
*

View File

@ -8,19 +8,19 @@ package org.hibernate.metamodel.model.domain;
import java.util.List;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
/**
* Describes any structural type without a direct java type representation.
*
* @author Christian Beikov
*/
public interface TupleType<J> extends SqmExpressable<J> {
public interface TupleType<J> extends SqmExpressible<J> {
int componentCount();
String getComponentName(int index);
List<String> getComponentNames();
SqmExpressable<?> get(int index);
SqmExpressable<?> get(String componentName);
SqmExpressible<?> get(int index);
SqmExpressible<?> get(String componentName);
}

View File

@ -92,8 +92,8 @@ public abstract class AbstractPluralAttribute<D, C, E>
}
@Override
public JavaType<E> getExpressableJavaType() {
return getElementType().getExpressableJavaType();
public JavaType<E> getExpressibleJavaType() {
return getElementType().getExpressibleJavaType();
}
@Override

View File

@ -48,7 +48,7 @@ public abstract class AbstractSqmPathSource<J> implements SqmPathSource<J> {
}
@Override
public JavaType<J> getExpressableJavaType() {
return domainType.getExpressableJavaType();
public JavaType<J> getExpressibleJavaType() {
return domainType.getExpressibleJavaType();
}
}

View File

@ -35,7 +35,7 @@ public class AnyMappingDomainTypeImpl<T> implements AnyMappingDomainType<T> {
}
@Override
public JavaType<T> getExpressableJavaType() {
public JavaType<T> getExpressibleJavaType() {
return baseJtd;
}

View File

@ -14,11 +14,11 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.mapping.IndexedConsumer;
import org.hibernate.metamodel.UnsupportedMappingException;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.ReturnableType;
import org.hibernate.metamodel.model.domain.TupleType;
import org.hibernate.query.BindableType;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.sql.ast.Clause;
import org.hibernate.type.descriptor.java.JavaType;
import org.hibernate.type.descriptor.java.ObjectArrayJavaType;
@ -29,20 +29,20 @@ import org.hibernate.type.descriptor.java.ObjectArrayJavaType;
public class ArrayTupleType implements TupleType<Object[]>,
BindableType<Object[]>,
ReturnableType<Object[]>,
MappingModelExpressable<Object[]> {
MappingModelExpressible<Object[]> {
private final ObjectArrayJavaType javaType;
private final SqmExpressable<?>[] components;
private final SqmExpressible<?>[] components;
public ArrayTupleType(SqmExpressable<?>[] components) {
public ArrayTupleType(SqmExpressible<?>[] components) {
this.components = components;
this.javaType = new ObjectArrayJavaType( getTypeDescriptors( components ) );
}
private static JavaType<?>[] getTypeDescriptors(SqmExpressable<?>[] components) {
private static JavaType<?>[] getTypeDescriptors(SqmExpressible<?>[] components) {
final JavaType<?>[] typeDescriptors = new JavaType<?>[components.length];
for ( int i = 0; i < components.length; i++ ) {
typeDescriptors[i] = components[i].getExpressableJavaType();
typeDescriptors[i] = components[i].getExpressibleJavaType();
}
return typeDescriptors;
}
@ -63,17 +63,17 @@ public class ArrayTupleType implements TupleType<Object[]>,
}
@Override
public SqmExpressable<?> get(int index) {
public SqmExpressible<?> get(int index) {
return components[index];
}
@Override
public SqmExpressable<?> get(String componentName) {
public SqmExpressible<?> get(String componentName) {
throw new UnsupportedMappingException( "Array tuple has no component names" );
}
@Override
public JavaType<Object[]> getExpressableJavaType() {
public JavaType<Object[]> getExpressibleJavaType() {
return javaType;
}
@ -84,7 +84,7 @@ public class ArrayTupleType implements TupleType<Object[]>,
@Override
public Class<Object[]> getJavaType() {
return getExpressableJavaType().getJavaTypeClass();
return this.getExpressibleJavaType().getJavaTypeClass();
}
@Override

View File

@ -63,7 +63,7 @@ public class BasicSqmPathSource<J>
@Override
public Class<J> getJavaType() {
return getExpressableJavaType().getJavaTypeClass();
return getExpressibleJavaType().getJavaTypeClass();
}
@Override

View File

@ -31,12 +31,12 @@ public class BasicTypeImpl<J> implements BasicDomainType<J>, Serializable {
}
@Override
public JavaType<J> getExpressableJavaType() {
public JavaType<J> getExpressibleJavaType() {
return javaType;
}
public Class<J> getJavaType() {
return getExpressableJavaType().getJavaTypeClass();
return this.getExpressibleJavaType().getJavaTypeClass();
}
@Override

View File

@ -59,6 +59,6 @@ public class DiscriminatorSqmPathSource<D> extends AbstractSqmPathSource<D>
@Override
public Class<D> getJavaType() {
return getExpressableJavaType().getJavaTypeClass();
return getExpressibleJavaType().getJavaTypeClass();
}
}

View File

@ -505,7 +505,7 @@ public class JpaMetamodelImpl implements JpaMetamodel, Serializable {
if ( embeddable.getJavaType() != null && embeddable.getJavaType() != Map.class ) {
this.jpaEmbeddables.add( embeddable );
this.jpaManagedTypes.add( embeddable );
if ( !( embeddable.getExpressableJavaType() instanceof EntityJavaType<?> ) ) {
if ( !( embeddable.getExpressibleJavaType() instanceof EntityJavaType<?> ) ) {
this.jpaManagedTypeMap.put( embeddable.getJavaType(), embeddable );
}
}
@ -514,7 +514,7 @@ public class JpaMetamodelImpl implements JpaMetamodel, Serializable {
this.jpaEmbeddables.add( embeddable );
this.jpaManagedTypes.add( embeddable );
if ( embeddable.getJavaType() != null
&& !( embeddable.getExpressableJavaType() instanceof EntityJavaType<?> ) ) {
&& !( embeddable.getExpressibleJavaType() instanceof EntityJavaType<?> ) ) {
this.jpaManagedTypeMap.put( embeddable.getJavaType(), embeddable );
}
break;
@ -522,7 +522,7 @@ public class JpaMetamodelImpl implements JpaMetamodel, Serializable {
if ( embeddable.getJavaType() == null ) {
throw new UnsupportedOperationException( "ANY not supported" );
}
if ( !( embeddable.getExpressableJavaType() instanceof EntityJavaType<?> ) ) {
if ( !( embeddable.getExpressibleJavaType() instanceof EntityJavaType<?> ) ) {
this.jpaManagedTypeMap.put( embeddable.getJavaType(), embeddable );
}
break;

View File

@ -48,7 +48,7 @@ import org.hibernate.mapping.PersistentClass;
import org.hibernate.metamodel.MappingMetamodel;
import org.hibernate.metamodel.internal.JpaMetaModelPopulationSetting;
import org.hibernate.metamodel.internal.JpaStaticMetaModelPopulationSetting;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess;
import org.hibernate.query.BindableType;
import org.hibernate.metamodel.model.domain.EmbeddableDomainType;
@ -65,7 +65,7 @@ import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.persister.entity.Queryable;
import org.hibernate.persister.spi.PersisterFactory;
import org.hibernate.query.spi.NavigablePath;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.tree.domain.SqmPath;
import org.hibernate.query.sqm.tree.expression.SqmFieldLiteral;
import org.hibernate.sql.ast.tree.from.TableGroup;
@ -155,7 +155,7 @@ public class MappingMetamodelImpl implements MappingMetamodel, MetamodelImplemen
private final TypeConfiguration typeConfiguration;
private final Map<String, String[]> implementorsCache = new ConcurrentHashMap<>();
private final Map<TupleType<?>, MappingModelExpressable<?>> tupleTypeCache = new ConcurrentHashMap<>();
private final Map<TupleType<?>, MappingModelExpressible<?>> tupleTypeCache = new ConcurrentHashMap<>();
public MappingMetamodelImpl(SessionFactoryImplementor sessionFactory, TypeConfiguration typeConfiguration) {
this.sessionFactory = sessionFactory;
@ -745,16 +745,16 @@ public class MappingMetamodelImpl implements MappingMetamodel, MetamodelImplemen
}
@Override
public MappingModelExpressable<?> lenientlyResolveMappingExpressable(
SqmExpressable<?> sqmExpressable,
public MappingModelExpressible<?> lenientlyResolveMappingExpressible(
SqmExpressible<?> sqmExpressible,
Function<NavigablePath, TableGroup> tableGroupLocator) {
return resolveMappingExpressable( sqmExpressable, tableGroupLocator );
return resolveMappingExpressible(sqmExpressible, tableGroupLocator );
}
@Override
public MappingModelExpressable<?> resolveMappingExpressable(SqmExpressable<?> sqmExpressable, Function<NavigablePath, TableGroup> tableGroupLocator) {
if ( sqmExpressable instanceof SqmPath ) {
final SqmPath<?> sqmPath = (SqmPath<?>) sqmExpressable;
public MappingModelExpressible<?> resolveMappingExpressible(SqmExpressible<?> sqmExpressible, Function<NavigablePath, TableGroup> tableGroupLocator) {
if ( sqmExpressible instanceof SqmPath ) {
final SqmPath<?> sqmPath = (SqmPath<?>) sqmExpressible;
final NavigablePath navigablePath = sqmPath.getNavigablePath();
if ( navigablePath.getParent() != null ) {
final TableGroup parentTableGroup = tableGroupLocator.apply( navigablePath.getParent() );
@ -763,48 +763,48 @@ public class MappingMetamodelImpl implements MappingMetamodel, MetamodelImplemen
return tableGroupLocator.apply( navigablePath.getParent() ).getModelPart();
}
if ( sqmExpressable instanceof BasicType<?> ) {
return (BasicType<?>) sqmExpressable;
if ( sqmExpressible instanceof BasicType<?> ) {
return (BasicType<?>) sqmExpressible;
}
if ( sqmExpressable instanceof BasicSqmPathSource<?> ) {
return getTypeConfiguration().getBasicTypeForJavaType(((BasicSqmPathSource<?>) sqmExpressable).getJavaType());
if ( sqmExpressible instanceof BasicSqmPathSource<?> ) {
return getTypeConfiguration().getBasicTypeForJavaType(((BasicSqmPathSource<?>) sqmExpressible).getJavaType());
}
if ( sqmExpressable instanceof SqmFieldLiteral ) {
return getTypeConfiguration().getBasicTypeForJavaType( ( (SqmFieldLiteral<?>) sqmExpressable ).getJavaType() );
if ( sqmExpressible instanceof SqmFieldLiteral ) {
return getTypeConfiguration().getBasicTypeForJavaType( ( (SqmFieldLiteral<?>) sqmExpressible).getJavaType() );
}
if ( sqmExpressable instanceof CompositeSqmPathSource ) {
throw new NotYetImplementedFor6Exception( "Resolution of embedded-valued SqmExpressable nodes not yet implemented" );
if ( sqmExpressible instanceof CompositeSqmPathSource ) {
throw new NotYetImplementedFor6Exception( "Resolution of embedded-valued SqmExpressible nodes not yet implemented" );
}
if ( sqmExpressable instanceof EmbeddableTypeImpl ) {
return (MappingModelExpressable<?>) sqmExpressable;
if ( sqmExpressible instanceof EmbeddableTypeImpl ) {
return (MappingModelExpressible<?>) sqmExpressible;
}
if ( sqmExpressable instanceof EntityDomainType<?> ) {
return getEntityDescriptor( ( (EntityDomainType<?>) sqmExpressable ).getHibernateEntityName() );
if ( sqmExpressible instanceof EntityDomainType<?> ) {
return getEntityDescriptor( ( (EntityDomainType<?>) sqmExpressible).getHibernateEntityName() );
}
if ( sqmExpressable instanceof TupleType<?> ) {
final MappingModelExpressable<?> mappingModelExpressable = tupleTypeCache.get( sqmExpressable );
if ( mappingModelExpressable != null ) {
return mappingModelExpressable;
if ( sqmExpressible instanceof TupleType<?> ) {
final MappingModelExpressible<?> mappingModelExpressible = tupleTypeCache.get(sqmExpressible);
if ( mappingModelExpressible != null ) {
return mappingModelExpressible;
}
final TupleType<?> tupleType = (TupleType<?>) sqmExpressable;
final MappingModelExpressable<?>[] components = new MappingModelExpressable<?>[tupleType.componentCount()];
final TupleType<?> tupleType = (TupleType<?>) sqmExpressible;
final MappingModelExpressible<?>[] components = new MappingModelExpressible<?>[tupleType.componentCount()];
for ( int i = 0; i < components.length; i++ ) {
components[i] = resolveMappingExpressable( tupleType.get( i ), tableGroupLocator );
components[i] = resolveMappingExpressible( tupleType.get( i ), tableGroupLocator );
}
final MappingModelExpressable<?> createdMappingModelExpressable = new TupleMappingModelExpressable( components );
final MappingModelExpressable<?> existingMappingModelExpressable = tupleTypeCache.putIfAbsent(
final MappingModelExpressible<?> createdMappingModelExpressible = new TupleMappingModelExpressible( components );
final MappingModelExpressible<?> existingMappingModelExpressible = tupleTypeCache.putIfAbsent(
tupleType,
createdMappingModelExpressable
createdMappingModelExpressible
);
return existingMappingModelExpressable == null
? createdMappingModelExpressable
: existingMappingModelExpressable;
return existingMappingModelExpressible == null
? createdMappingModelExpressible
: existingMappingModelExpressible;
}
return null;
}

View File

@ -58,7 +58,7 @@ public class SingularAttributeImpl<D,J>
super(
declaringType,
name,
attributeType.getExpressableJavaType(),
attributeType.getExpressibleJavaType(),
attributeClassification,
attributeType,
member,
@ -81,8 +81,8 @@ public class SingularAttributeImpl<D,J>
return getName();
}
public JavaType<J> getExpressableJavaType() {
return sqmPathSource.getExpressableJavaType();
public JavaType<J> getExpressibleJavaType() {
return sqmPathSource.getExpressibleJavaType();
}
@Override
@ -108,7 +108,7 @@ public class SingularAttributeImpl<D,J>
@Override
public Class<J> getBindableJavaType() {
return getExpressableJavaType().getJavaTypeClass();
return getExpressibleJavaType().getJavaTypeClass();
}
@Override

View File

@ -9,18 +9,18 @@ package org.hibernate.metamodel.model.domain.internal;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.mapping.IndexedConsumer;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.sql.ast.Clause;
/**
* @author Christian Beikov
*/
public class TupleMappingModelExpressable implements MappingModelExpressable {
public class TupleMappingModelExpressible implements MappingModelExpressible {
private final MappingModelExpressable<Object>[] components;
private final MappingModelExpressible<Object>[] components;
public TupleMappingModelExpressable(MappingModelExpressable<?>[] components) {
this.components = (MappingModelExpressable<Object>[]) components;
public TupleMappingModelExpressible(MappingModelExpressible<?>[] components) {
this.components = (MappingModelExpressible<Object>[]) components;
}
@Override

View File

@ -55,7 +55,7 @@ public class DiscriminatorType<T> extends AbstractType implements BasicType<T>,
}
@Override
public Class getReturnedClass() {
public Class<?> getReturnedClass() {
return Class.class;
}
@ -133,7 +133,7 @@ public class DiscriminatorType<T> extends AbstractType implements BasicType<T>,
Object value,
int index,
SharedSessionContractImplementor session) throws HibernateException, SQLException {
String entityName = session.getFactory().getClassMetadata((Class) value).getEntityName();
String entityName = session.getFactory().getClassMetadata((Class<?>) value).getEntityName();
Loadable entityPersister = (Loadable) session.getFactory().getMetamodel().entityPersister(entityName);
underlyingType.nullSafeSet(st, entityPersister.getDiscriminatorValue(), index, session);
}
@ -141,7 +141,7 @@ public class DiscriminatorType<T> extends AbstractType implements BasicType<T>,
@Override
public void bind(PreparedStatement st, T value, int index, WrapperOptions options) throws SQLException {
final SessionFactoryImplementor factory = options.getSession().getFactory();
final String entityName = factory.getClassMetadata( (Class) value).getEntityName();
final String entityName = factory.getClassMetadata( (Class<?>) value).getEntityName();
final Loadable entityPersister = (Loadable) factory.getMetamodel().entityPersister(entityName);
underlyingType.getJdbcValueBinder().bind( st, entityPersister.getDiscriminatorValue(), index, options );
}
@ -149,7 +149,7 @@ public class DiscriminatorType<T> extends AbstractType implements BasicType<T>,
@Override
public void bind(CallableStatement st, T value, String name, WrapperOptions options) throws SQLException {
final SessionFactoryImplementor factory = options.getSession().getFactory();
final String entityName = factory.getClassMetadata( (Class) value).getEntityName();
final String entityName = factory.getClassMetadata( (Class<?>) value).getEntityName();
final Loadable entityPersister = (Loadable) factory.getMetamodel().entityPersister(entityName);
underlyingType.getJdbcValueBinder().bind( st, entityPersister.getDiscriminatorValue(), name, options );
}
@ -204,7 +204,7 @@ public class DiscriminatorType<T> extends AbstractType implements BasicType<T>,
@SuppressWarnings("unchecked")
@Override
public JavaType<T> getExpressableJavaType() {
public JavaType<T> getExpressibleJavaType() {
return (JavaType<T>) (persister.getRepresentationStrategy().getMode() == RepresentationMode.POJO
? ClassJavaType.INSTANCE
: StringJavaType.INSTANCE);
@ -212,12 +212,12 @@ public class DiscriminatorType<T> extends AbstractType implements BasicType<T>,
@Override
public JavaType<T> getJavaTypeDescriptor() {
return getExpressableJavaType();
return this.getExpressibleJavaType();
}
@Override
public JavaType<T> getMappedJavaType() {
return getExpressableJavaType();
return this.getExpressibleJavaType();
}
@Override

View File

@ -58,7 +58,7 @@ import org.hibernate.query.spi.QueryOptionsAdapter;
import org.hibernate.query.spi.QueryParameterBinding;
import org.hibernate.query.spi.QueryParameterBindings;
import org.hibernate.query.spi.ScrollableResultsImplementor;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.result.NoMoreReturnsException;
import org.hibernate.result.Output;
import org.hibernate.result.ResultSetOutput;
@ -460,21 +460,21 @@ public class ProcedureCallImpl<R>
.getDomainModel()
.resolveQueryParameterType( javaType );
final Class<T> expressableJavaType;
final Class<T> expressibleJavaType;
if ( parameterType == null ) {
expressableJavaType = null;
expressibleJavaType = null;
}
else {
final SqmExpressable<T> sqmExpressable = parameterType.resolveExpressable( getSessionFactory() );
assert sqmExpressable != null;
final SqmExpressible<T> sqmExpressible = parameterType.resolveExpressible( getSessionFactory() );
assert sqmExpressible != null;
expressableJavaType = sqmExpressable.getExpressableJavaType().getJavaTypeClass();
expressibleJavaType = sqmExpressible.getExpressibleJavaType().getJavaTypeClass();
}
final ProcedureParameterImpl<T> procedureParameter = new ProcedureParameterImpl<>(
position,
mode,
expressableJavaType,
expressibleJavaType,
parameterType
);
registerParameter( procedureParameter );

View File

@ -9,7 +9,7 @@ package org.hibernate.query;
import org.hibernate.Incubating;
import org.hibernate.NotYetImplementedFor6Exception;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import jakarta.persistence.AttributeConverter;
import jakarta.persistence.metamodel.ManagedType;
@ -54,9 +54,9 @@ public interface BindableType<J> {
}
/**
* Resolve this parameter type to the corresponding SqmExpressable
* Resolve this parameter type to the corresponding SqmExpressible
*
* @todo (6.0) - use SessionFactory (API) here instead - we'll just cast "below"
*/
SqmExpressable<J> resolveExpressable(SessionFactoryImplementor sessionFactory);
SqmExpressible<J> resolveExpressible(SessionFactoryImplementor sessionFactory);
}

View File

@ -20,7 +20,7 @@ import org.hibernate.metamodel.model.domain.EntityDomainType;
import org.hibernate.query.criteria.JpaSelection;
import org.hibernate.query.hql.HqlInterpretationException;
import org.hibernate.query.sqm.NodeBuilder;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.SemanticQueryWalker;
import org.hibernate.query.hql.spi.SqmCreationState;
import org.hibernate.query.sqm.tree.expression.SqmEnumLiteral;
@ -37,7 +37,7 @@ import org.hibernate.type.descriptor.java.JavaType;
public class FullyQualifiedReflectivePathTerminal
extends FullyQualifiedReflectivePath
implements SqmExpression {
private final SqmExpressable expressableType;
private final SqmExpressible expressibleType;
private final SqmCreationState creationState;
private final Function<SemanticQueryWalker,?> handler;
@ -52,7 +52,7 @@ public class FullyQualifiedReflectivePathTerminal
this.handler = resolveTerminalSemantic();
// todo (6.0) : how to calculate this?
this.expressableType = null;
this.expressibleType = null;
}
@SuppressWarnings("unchecked")
@ -124,8 +124,8 @@ public class FullyQualifiedReflectivePathTerminal
}
@Override
public SqmExpressable getNodeType() {
return expressableType;
public SqmExpressible getNodeType() {
return expressibleType;
}
@Override
@ -135,12 +135,12 @@ public class FullyQualifiedReflectivePathTerminal
@Override
public JavaType getJavaTypeDescriptor() {
return expressableType.getExpressableJavaType();
return expressibleType.getExpressibleJavaType();
}
@Override
public void applyInferableType(SqmExpressable type) {
public void applyInferableType(SqmExpressible type) {
}
@Override

View File

@ -76,7 +76,7 @@ import org.hibernate.query.hql.spi.SqmPathRegistry;
import org.hibernate.query.sqm.LiteralNumberFormatException;
import org.hibernate.query.sqm.NodeBuilder;
import org.hibernate.query.sqm.ParsingException;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.SqmPathSource;
import org.hibernate.query.sqm.SqmQuerySource;
import org.hibernate.query.sqm.SqmTreeCreationLogger;
@ -2317,7 +2317,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
return new SqmToDuration<>(
(SqmExpression<?>) ctx.getChild( 0 ).accept( this ),
toDurationUnit( (SqmExtractUnit<?>) ctx.getChild( 1 ).accept( this ) ),
resolveExpressableTypeBasic( Duration.class ),
resolveExpressibleTypeBasic( Duration.class ),
creationContext.getNodeBuilder()
);
}
@ -2325,7 +2325,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
private SqmDurationUnit<Long> toDurationUnit(SqmExtractUnit<?> extractUnit) {
return new SqmDurationUnit<>(
extractUnit.getUnit(),
resolveExpressableTypeBasic( Long.class ),
resolveExpressibleTypeBasic( Long.class ),
creationContext.getNodeBuilder()
);
}
@ -2335,7 +2335,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
return new SqmByUnit(
toDurationUnit( (SqmExtractUnit<?>) ctx.getChild( 2 ).accept( this ) ),
(SqmExpression<?>) ctx.getChild( 0 ).accept( this ),
resolveExpressableTypeBasic( Long.class ),
resolveExpressibleTypeBasic( Long.class ),
creationContext.getNodeBuilder()
);
}
@ -2474,7 +2474,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public SqmExpression<?> visitCurrentDateFunction(HqlParser.CurrentDateFunctionContext ctx) {
return getFunctionDescriptor("current_date")
.generateSqmExpression(
resolveExpressableTypeBasic( Date.class ),
resolveExpressibleTypeBasic( Date.class ),
creationContext.getQueryEngine(),
creationContext.getJpaMetamodel().getTypeConfiguration()
);
@ -2484,7 +2484,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public SqmExpression<?> visitCurrentTimeFunction(HqlParser.CurrentTimeFunctionContext ctx) {
return getFunctionDescriptor("current_time")
.generateSqmExpression(
resolveExpressableTypeBasic( Time.class ),
resolveExpressibleTypeBasic( Time.class ),
creationContext.getQueryEngine(),
creationContext.getJpaMetamodel().getTypeConfiguration()
);
@ -2494,7 +2494,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public SqmExpression<?> visitCurrentTimestampFunction(HqlParser.CurrentTimestampFunctionContext ctx) {
return getFunctionDescriptor("current_timestamp")
.generateSqmExpression(
resolveExpressableTypeBasic( Timestamp.class ),
resolveExpressibleTypeBasic( Timestamp.class ),
creationContext.getQueryEngine(),
creationContext.getJpaMetamodel().getTypeConfiguration()
);
@ -2504,7 +2504,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public SqmExpression<?> visitInstantFunction(HqlParser.InstantFunctionContext ctx) {
return getFunctionDescriptor("instant")
.generateSqmExpression(
resolveExpressableTypeBasic( Instant.class ),
resolveExpressibleTypeBasic( Instant.class ),
creationContext.getQueryEngine(),
creationContext.getJpaMetamodel().getTypeConfiguration()
);
@ -2514,7 +2514,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public SqmExpression<?> visitLocalDateFunction(HqlParser.LocalDateFunctionContext ctx) {
return getFunctionDescriptor("local_date")
.generateSqmExpression(
resolveExpressableTypeBasic( LocalDate.class ),
resolveExpressibleTypeBasic( LocalDate.class ),
creationContext.getQueryEngine(),
creationContext.getJpaMetamodel().getTypeConfiguration()
);
@ -2524,7 +2524,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public SqmExpression<?> visitLocalTimeFunction(HqlParser.LocalTimeFunctionContext ctx) {
return getFunctionDescriptor("local_time")
.generateSqmExpression(
resolveExpressableTypeBasic( LocalTime.class ),
resolveExpressibleTypeBasic( LocalTime.class ),
creationContext.getQueryEngine(),
creationContext.getJpaMetamodel().getTypeConfiguration()
);
@ -2534,7 +2534,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public SqmExpression<?> visitLocalDateTimeFunction(HqlParser.LocalDateTimeFunctionContext ctx) {
return getFunctionDescriptor("local_datetime")
.generateSqmExpression(
resolveExpressableTypeBasic( LocalDateTime.class ),
resolveExpressibleTypeBasic( LocalDateTime.class ),
creationContext.getQueryEngine(),
creationContext.getJpaMetamodel().getTypeConfiguration()
);
@ -2544,7 +2544,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public SqmExpression<?> visitOffsetDateTimeFunction(HqlParser.OffsetDateTimeFunctionContext ctx) {
return getFunctionDescriptor("offset_datetime")
.generateSqmExpression(
resolveExpressableTypeBasic( OffsetDateTime.class ),
resolveExpressibleTypeBasic( OffsetDateTime.class ),
creationContext.getQueryEngine(),
creationContext.getJpaMetamodel().getTypeConfiguration()
);
@ -2722,7 +2722,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
if ( timezone == null ) {
return new SqmLiteral<>(
LocalDateTime.of( localDate( date ), localTime( time ) ),
resolveExpressableTypeBasic( LocalDateTime.class ),
resolveExpressibleTypeBasic( LocalDateTime.class ),
creationContext.getNodeBuilder()
);
}
@ -2730,7 +2730,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final ZoneId zoneId = visitZoneId( timezone );
return new SqmLiteral<>(
ZonedDateTime.of( localDate( date ), localTime( time ), zoneId ),
resolveExpressableTypeBasic( ZonedDateTime.class ),
resolveExpressibleTypeBasic( ZonedDateTime.class ),
creationContext.getNodeBuilder()
);
}
@ -2761,7 +2761,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
HqlParser.OffsetContext offset) {
return new SqmLiteral<>(
OffsetDateTime.of( localDate( date ), localTime( time ), zoneOffset( offset ) ),
resolveExpressableTypeBasic( OffsetDateTime.class ),
resolveExpressibleTypeBasic( OffsetDateTime.class ),
creationContext.getNodeBuilder()
);
}
@ -2770,7 +2770,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public Object visitDate(HqlParser.DateContext ctx) {
return new SqmLiteral<>(
localDate( ctx ),
resolveExpressableTypeBasic( LocalDate.class ),
resolveExpressibleTypeBasic( LocalDate.class ),
creationContext.getNodeBuilder()
);
}
@ -2779,7 +2779,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public Object visitTime(HqlParser.TimeContext ctx) {
return new SqmLiteral<>(
localTime( ctx ),
resolveExpressableTypeBasic( LocalTime.class ),
resolveExpressibleTypeBasic( LocalTime.class ),
creationContext.getNodeBuilder()
);
}
@ -2835,7 +2835,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
// TemporalAccessor parsed = OFFSET_DATE_TIME.parse( literalText );
// return new SqmLiteral<>(
// OffsetDateTime.from( parsed ),
// resolveExpressableTypeBasic( OffsetDateTime.class ),
// resolveExpressibleTypeBasic( OffsetDateTime.class ),
// creationContext.getNodeBuilder()
// );
// }
@ -2846,14 +2846,14 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
// try {
// return new SqmLiteral<>(
// ZonedDateTime.from( parsed ),
// resolveExpressableTypeBasic( ZonedDateTime.class ),
// resolveExpressibleTypeBasic( ZonedDateTime.class ),
// creationContext.getNodeBuilder()
// );
// }
// catch (DateTimeException dte) {
// return new SqmLiteral<>(
// LocalDateTime.from( parsed ),
// resolveExpressableTypeBasic( LocalDateTime.class ),
// resolveExpressibleTypeBasic( LocalDateTime.class ),
// creationContext.getNodeBuilder()
// );
// }
@ -2862,7 +2862,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
// private SqmLiteral<LocalDate> localDateLiteralFrom(String literalText) {
// return new SqmLiteral<>(
// LocalDate.from( ISO_LOCAL_DATE.parse( literalText ) ),
// resolveExpressableTypeBasic( LocalDate.class ),
// resolveExpressibleTypeBasic( LocalDate.class ),
// creationContext.getNodeBuilder()
// );
// }
@ -2870,7 +2870,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
// private SqmLiteral<LocalTime> localTimeLiteralFrom(String literalText) {
// return new SqmLiteral<>(
// LocalTime.from( ISO_LOCAL_TIME.parse( literalText ) ),
// resolveExpressableTypeBasic( LocalTime.class ),
// resolveExpressibleTypeBasic( LocalTime.class ),
// creationContext.getNodeBuilder()
// );
// }
@ -2882,7 +2882,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final Calendar literal = GregorianCalendar.from( zonedDateTime );
return new SqmLiteral<>(
literal,
resolveExpressableTypeBasic( Calendar.class ),
resolveExpressibleTypeBasic( Calendar.class ),
creationContext.getNodeBuilder()
);
}
@ -2891,7 +2891,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final Timestamp literal = Timestamp.valueOf( localDateTime );
return new SqmLiteral<>(
literal,
resolveExpressableTypeBasic( Timestamp.class ),
resolveExpressibleTypeBasic( Timestamp.class ),
creationContext.getNodeBuilder()
);
}
@ -2902,7 +2902,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final Date literal = Date.valueOf( localDate );
return new SqmLiteral<>(
literal,
resolveExpressableTypeBasic( Date.class ),
resolveExpressibleTypeBasic( Date.class ),
creationContext.getNodeBuilder()
);
}
@ -2912,7 +2912,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final Time literal = Time.valueOf( localTime );
return new SqmLiteral<>(
literal,
resolveExpressableTypeBasic( Time.class ),
resolveExpressibleTypeBasic( Time.class ),
creationContext.getNodeBuilder()
);
}
@ -2920,7 +2920,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
private SqmLiteral<Boolean> booleanLiteral(boolean value) {
return new SqmLiteral<>(
value,
resolveExpressableTypeBasic( Boolean.class ),
resolveExpressibleTypeBasic( Boolean.class ),
creationContext.getNodeBuilder()
);
}
@ -2928,7 +2928,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
private SqmLiteral<String> stringLiteral(String text) {
return new SqmLiteral<>(
QuotingHelper.unquoteStringLiteral( text ),
resolveExpressableTypeBasic( String.class ),
resolveExpressibleTypeBasic( String.class ),
creationContext.getNodeBuilder()
);
}
@ -2938,7 +2938,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
PrimitiveByteArrayJavaType.INSTANCE.fromString(
CharSequenceHelper.subSequence( text, 2, text.length() - 1 )
),
resolveExpressableTypeBasic( byte[].class ),
resolveExpressibleTypeBasic( byte[].class ),
creationContext.getNodeBuilder()
);
}
@ -2948,7 +2948,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final Integer value = Integer.valueOf( text );
return new SqmLiteral<>(
value,
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
creationContext.getNodeBuilder()
);
}
@ -2958,7 +2958,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final Long value = Long.valueOf( text );
return new SqmLiteral<>(
value,
resolveExpressableTypeBasic( Long.class ),
resolveExpressibleTypeBasic( Long.class ),
creationContext.getNodeBuilder()
);
}
@ -2977,7 +2977,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final Integer value = Integer.valueOf( text );
return new SqmLiteral<>(
value,
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
creationContext.getNodeBuilder()
);
}
@ -2998,7 +2998,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final Long value = Long.valueOf( text );
return new SqmLiteral<>(
value,
resolveExpressableTypeBasic( Long.class ),
resolveExpressibleTypeBasic( Long.class ),
creationContext.getNodeBuilder()
);
}
@ -3019,16 +3019,16 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
if ( text.endsWith( "l" ) || text.endsWith( "L" ) ) {
text = text.substring( 0, text.length() - 1 );
value = Long.parseUnsignedLong( text, 16 );
type = resolveExpressableTypeBasic( Long.class );
type = resolveExpressibleTypeBasic( Long.class );
}
else {
value = Integer.parseUnsignedInt( text, 16 );
type = resolveExpressableTypeBasic( Integer.class );
type = resolveExpressibleTypeBasic( Integer.class );
}
//noinspection unchecked
return new SqmLiteral<>(
value,
(SqmExpressable<Number>) type,
(SqmExpressible<Number>) type,
creationContext.getNodeBuilder()
);
}
@ -3048,7 +3048,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
}
return new SqmLiteral<>(
new BigInteger( text ),
resolveExpressableTypeBasic( BigInteger.class ),
resolveExpressibleTypeBasic( BigInteger.class ),
creationContext.getNodeBuilder()
);
}
@ -3064,7 +3064,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
try {
return new SqmLiteral<>(
Float.valueOf( text ),
resolveExpressableTypeBasic( Float.class ),
resolveExpressibleTypeBasic( Float.class ),
creationContext.getNodeBuilder()
);
}
@ -3080,7 +3080,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
try {
return new SqmLiteral<>(
Double.valueOf( text ),
resolveExpressableTypeBasic( Double.class ),
resolveExpressibleTypeBasic( Double.class ),
creationContext.getNodeBuilder()
);
}
@ -3100,7 +3100,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
}
return new SqmLiteral<>(
new BigDecimal( text ),
resolveExpressableTypeBasic( BigDecimal.class ),
resolveExpressibleTypeBasic( BigDecimal.class ),
creationContext.getNodeBuilder()
);
}
@ -3112,7 +3112,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
}
}
private <J> BasicType<J> resolveExpressableTypeBasic(Class<J> javaType) {
private <J> BasicType<J> resolveExpressibleTypeBasic(Class<J> javaType) {
return creationContext.getJpaMetamodel().getTypeConfiguration().standardBasicTypeForJavaType( javaType );
}
@ -3171,7 +3171,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
true,
null,
StandardFunctionReturnTypeResolvers.invariant(
resolveExpressableTypeBasic( Object.class )
resolveExpressibleTypeBasic( Object.class )
)
);
}
@ -3227,7 +3227,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
true,
null,
StandardFunctionReturnTypeResolvers.invariant(
resolveExpressableTypeBasic( Object.class )
resolveExpressibleTypeBasic( Object.class )
),
functionName,
filterExpression != null ? FunctionKind.AGGREGATE : FunctionKind.NORMAL,
@ -3330,55 +3330,55 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
case HqlParser.DAY:
return new SqmExtractUnit<>(
TemporalUnit.DAY,
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
nodeBuilder
);
case HqlParser.MONTH:
return new SqmExtractUnit<>(
TemporalUnit.MONTH,
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
nodeBuilder
);
case HqlParser.YEAR:
return new SqmExtractUnit<>(
TemporalUnit.YEAR,
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
nodeBuilder
);
case HqlParser.HOUR:
return new SqmExtractUnit<>(
TemporalUnit.HOUR,
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
nodeBuilder
);
case HqlParser.MINUTE:
return new SqmExtractUnit<>(
TemporalUnit.MINUTE,
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
nodeBuilder
);
case HqlParser.SECOND:
return new SqmExtractUnit<>(
TemporalUnit.SECOND,
resolveExpressableTypeBasic( Float.class ),
resolveExpressibleTypeBasic( Float.class ),
nodeBuilder
);
case HqlParser.NANOSECOND:
return new SqmExtractUnit<>(
NANOSECOND,
resolveExpressableTypeBasic( Long.class ),
resolveExpressibleTypeBasic( Long.class ),
nodeBuilder
);
case HqlParser.WEEK:
return new SqmExtractUnit<>(
TemporalUnit.WEEK,
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
nodeBuilder
);
case HqlParser.QUARTER:
return new SqmExtractUnit<>(
TemporalUnit.QUARTER,
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
nodeBuilder
);
}
@ -3390,11 +3390,11 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final NodeBuilder nodeBuilder = creationContext.getNodeBuilder();
switch ( ( (TerminalNode) ctx.getChild( 2 ) ).getSymbol().getType() ) {
case HqlParser.MONTH:
return new SqmExtractUnit<>( DAY_OF_MONTH, resolveExpressableTypeBasic( Integer.class ), nodeBuilder );
return new SqmExtractUnit<>( DAY_OF_MONTH, resolveExpressibleTypeBasic( Integer.class ), nodeBuilder );
case HqlParser.WEEK:
return new SqmExtractUnit<>( DAY_OF_WEEK, resolveExpressableTypeBasic( Integer.class ), nodeBuilder );
return new SqmExtractUnit<>( DAY_OF_WEEK, resolveExpressibleTypeBasic( Integer.class ), nodeBuilder );
case HqlParser.YEAR:
return new SqmExtractUnit<>( DAY_OF_YEAR, resolveExpressableTypeBasic( Integer.class ), nodeBuilder );
return new SqmExtractUnit<>( DAY_OF_YEAR, resolveExpressibleTypeBasic( Integer.class ), nodeBuilder );
}
throw new ParsingException("Unsupported day field [" + ctx.getText() + "]");
}
@ -3405,10 +3405,10 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
switch ( ( (TerminalNode) ctx.getChild( 2 ) ).getSymbol().getType() ) {
case HqlParser.MONTH:
//this is computed from DAY_OF_MONTH/7
return new SqmExtractUnit<>( WEEK_OF_MONTH, resolveExpressableTypeBasic( Integer.class ), nodeBuilder );
return new SqmExtractUnit<>( WEEK_OF_MONTH, resolveExpressibleTypeBasic( Integer.class ), nodeBuilder );
case HqlParser.YEAR:
//this is computed from DAY_OF_YEAR/7
return new SqmExtractUnit<>( WEEK_OF_YEAR, resolveExpressableTypeBasic( Integer.class ), nodeBuilder );
return new SqmExtractUnit<>( WEEK_OF_YEAR, resolveExpressibleTypeBasic( Integer.class ), nodeBuilder );
}
throw new ParsingException("Unsupported week field [" + ctx.getText() + "]");
}
@ -3419,12 +3419,12 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
switch ( ( (TerminalNode) ctx.getChild( 0 ) ).getSymbol().getType() ) {
case HqlParser.DATE:
return isExtractingJdbcTemporalType
? new SqmExtractUnit<>( DATE, resolveExpressableTypeBasic( Date.class ), nodeBuilder )
: new SqmExtractUnit<>( DATE, resolveExpressableTypeBasic( LocalDate.class ), nodeBuilder );
? new SqmExtractUnit<>( DATE, resolveExpressibleTypeBasic( Date.class ), nodeBuilder )
: new SqmExtractUnit<>( DATE, resolveExpressibleTypeBasic( LocalDate.class ), nodeBuilder );
case HqlParser.TIME:
return isExtractingJdbcTemporalType
? new SqmExtractUnit<>( TIME, resolveExpressableTypeBasic( Time.class ), nodeBuilder )
: new SqmExtractUnit<>( TIME, resolveExpressableTypeBasic( LocalTime.class ), nodeBuilder );
? new SqmExtractUnit<>( TIME, resolveExpressibleTypeBasic( Time.class ), nodeBuilder )
: new SqmExtractUnit<>( TIME, resolveExpressibleTypeBasic( LocalTime.class ), nodeBuilder );
}
throw new ParsingException("Unsupported date or time field [" + ctx.getText() + "]");
}
@ -3434,15 +3434,15 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final NodeBuilder nodeBuilder = creationContext.getNodeBuilder();
switch ( ( (TerminalNode) ctx.getChild( ctx.getChildCount() - 1 ) ).getSymbol().getType() ) {
case HqlParser.TIMEZONE_HOUR:
return new SqmExtractUnit<>( TIMEZONE_HOUR, resolveExpressableTypeBasic( Integer.class ), nodeBuilder );
return new SqmExtractUnit<>( TIMEZONE_HOUR, resolveExpressibleTypeBasic( Integer.class ), nodeBuilder );
case HqlParser.TIMEZONE_MINUTE:
return new SqmExtractUnit<>(
TIMEZONE_MINUTE,
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
nodeBuilder
);
default:
return new SqmExtractUnit<>( OFFSET, resolveExpressableTypeBasic( ZoneOffset.class ), nodeBuilder );
return new SqmExtractUnit<>( OFFSET, resolveExpressibleTypeBasic( ZoneOffset.class ), nodeBuilder );
}
}
@ -3480,7 +3480,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final String format = QuotingHelper.unquoteStringLiteral( ctx.getChild( 0 ).getText() );
return new SqmFormat(
format,
resolveExpressableTypeBasic( String.class ),
resolveExpressibleTypeBasic( String.class ),
creationContext.getNodeBuilder()
);
}
@ -3593,7 +3593,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
return getFunctionDescriptor( "every" ).generateAggregateSqmExpression(
singletonList( argument ),
filterExpression,
resolveExpressableTypeBasic( Boolean.class ),
resolveExpressibleTypeBasic( Boolean.class ),
creationContext.getQueryEngine(),
creationContext.getJpaMetamodel().getTypeConfiguration()
);
@ -3629,7 +3629,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
return getFunctionDescriptor( "any" ).generateAggregateSqmExpression(
singletonList( argument ),
filterExpression,
resolveExpressableTypeBasic( Boolean.class ),
resolveExpressibleTypeBasic( Boolean.class ),
creationContext.getQueryEngine(),
creationContext.getJpaMetamodel().getTypeConfiguration()
);
@ -3789,7 +3789,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
return new SqmLiteral<>(
padCharText.charAt( 1 ),
resolveExpressableTypeBasic( Character.class ),
resolveExpressibleTypeBasic( Character.class ),
creationContext.getNodeBuilder()
);
}
@ -3858,7 +3858,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
return new SqmLiteral<>(
trimCharText.charAt( 0 ),
resolveExpressableTypeBasic( Character.class ),
resolveExpressibleTypeBasic( Character.class ),
creationContext.getNodeBuilder()
);
}
@ -3867,7 +3867,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
public SqmCollectionSize visitCollectionSizeFunction(HqlParser.CollectionSizeFunctionContext ctx) {
return new SqmCollectionSize(
consumeDomainPath( (HqlParser.PathContext) ctx.getChild( 2 ) ),
resolveExpressableTypeBasic( Integer.class ),
resolveExpressibleTypeBasic( Integer.class ),
creationContext.getNodeBuilder()
);
}

View File

@ -15,7 +15,7 @@ import java.util.Calendar;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.query.BindableType;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.type.descriptor.java.TemporalJavaType;
import org.hibernate.type.spi.TypeConfiguration;
@ -39,14 +39,14 @@ public class BindingTypeHelper {
BindableType<T> declaredParameterType,
SessionFactoryImplementor sessionFactory) {
if ( precision != null ) {
final SqmExpressable<T> sqmExpressable = declaredParameterType.resolveExpressable( sessionFactory );
if ( !( sqmExpressable.getExpressableJavaType() instanceof TemporalJavaType ) ) {
final SqmExpressible<T> sqmExpressible = declaredParameterType.resolveExpressible( sessionFactory );
if ( !( sqmExpressible.getExpressibleJavaType() instanceof TemporalJavaType ) ) {
throw new UnsupportedOperationException(
"Cannot treat non-temporal parameter type with temporal precision"
);
}
final TemporalJavaType<T> temporalJtd = (TemporalJavaType<T>) sqmExpressable.getExpressableJavaType();
final TemporalJavaType<T> temporalJtd = (TemporalJavaType<T>) sqmExpressible.getExpressibleJavaType();
if ( temporalJtd.getPrecision() != precision ) {
final TypeConfiguration typeConfiguration = sessionFactory.getTypeConfiguration();
return typeConfiguration.getBasicTypeRegistry().resolve(

View File

@ -6,7 +6,7 @@
*/
package org.hibernate.query.internal;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.SqmPathSource;
/**
@ -18,7 +18,7 @@ public class QueryHelper {
}
@SafeVarargs
public static <T> SqmExpressable<? extends T> highestPrecedenceType(SqmExpressable<? extends T>... types) {
public static <T> SqmExpressible<? extends T> highestPrecedenceType(SqmExpressible<? extends T>... types) {
if ( types == null || types.length == 0 ) {
return null;
}
@ -27,7 +27,7 @@ public class QueryHelper {
return types[0];
}
SqmExpressable<? extends T> highest = highestPrecedenceType2( types[0], types[1] );
SqmExpressible<? extends T> highest = highestPrecedenceType2( types[0], types[1] );
for ( int i = 2; i < types.length; i++ ) {
highest = highestPrecedenceType2( highest, types[i] );
}
@ -35,9 +35,9 @@ public class QueryHelper {
return highest;
}
public static <X> SqmExpressable<? extends X> highestPrecedenceType2(
SqmExpressable<? extends X> type1,
SqmExpressable<? extends X> type2) {
public static <X> SqmExpressible<? extends X> highestPrecedenceType2(
SqmExpressible<? extends X> type1,
SqmExpressible<? extends X> type2) {
if ( type1 == null && type2 == null ) {
return null;
}
@ -57,7 +57,7 @@ public class QueryHelper {
}
// any other precedence rules?
if ( type2.getExpressableJavaType().isWider( type1.getExpressableJavaType() ) ) {
if ( type2.getExpressibleJavaType().isWider( type1.getExpressibleJavaType() ) ) {
return type2;
}

View File

@ -12,12 +12,12 @@ import java.util.Iterator;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.metamodel.mapping.BasicValuedMapping;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.BindableType;
import org.hibernate.query.QueryParameter;
import org.hibernate.query.spi.QueryParameterBinding;
import org.hibernate.query.spi.QueryParameterBindingValidator;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.type.descriptor.java.CoercionException;
import org.hibernate.type.descriptor.java.JavaType;
import org.hibernate.type.descriptor.java.TemporalJavaType;
@ -38,7 +38,7 @@ public class QueryParameterBindingImpl<T> implements QueryParameterBinding<T>, J
private boolean isMultiValued;
private BindableType<? extends T> bindType;
private MappingModelExpressable<T> type;
private MappingModelExpressible<T> type;
private TemporalType explicitTemporalPrecision;
private T bindValue;
@ -140,10 +140,10 @@ public class QueryParameterBindingImpl<T> implements QueryParameterBinding<T>, J
return null;
}
final SqmExpressable<? extends T> sqmExpressable = parameterType.resolveExpressable( sessionFactory );
assert sqmExpressable != null;
final SqmExpressible<? extends T> sqmExpressible = parameterType.resolveExpressible( sessionFactory );
assert sqmExpressible != null;
return sqmExpressable.getExpressableJavaType().coerce( value, this );
return sqmExpressible.getExpressibleJavaType().coerce( value, this );
}
private boolean handleAsMultiValue(T value) {
@ -302,19 +302,19 @@ public class QueryParameterBindingImpl<T> implements QueryParameterBinding<T>, J
}
private JavaType<? extends T> determineJavaType(BindableType<? extends T> bindType) {
final SqmExpressable<? extends T> sqmExpressable = bindType.resolveExpressable( sessionFactory );
assert sqmExpressable != null;
final SqmExpressible<? extends T> sqmExpressible = bindType.resolveExpressible( sessionFactory );
assert sqmExpressible != null;
return sqmExpressable.getExpressableJavaType();
return sqmExpressible.getExpressibleJavaType();
}
@Override
public MappingModelExpressable<T> getType() {
public MappingModelExpressible<T> getType() {
return type;
}
@Override @SuppressWarnings("unchecked")
public boolean setType(MappingModelExpressable<T> type) {
public boolean setType(MappingModelExpressible<T> type) {
this.type = type;
if ( bindType == null || bindType.getBindableJavaType() == Object.class ) {
if ( type instanceof BindableType<?> ) {

View File

@ -21,14 +21,14 @@ import org.hibernate.QueryParameterException;
import org.hibernate.cache.spi.QueryKey;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.QueryParameter;
import org.hibernate.query.spi.ParameterMetadataImplementor;
import org.hibernate.query.spi.QueryParameterBinding;
import org.hibernate.query.spi.QueryParameterBindings;
import org.hibernate.query.spi.QueryParameterImplementor;
import org.hibernate.type.descriptor.java.JavaType;
import org.hibernate.type.descriptor.java.JavaTypedExpressable;
import org.hibernate.type.descriptor.java.JavaTypedExpressible;
import org.hibernate.type.spi.TypeConfiguration;
/**
@ -170,10 +170,10 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
int hashCode = 0;
for ( QueryParameterBinding<?> binding : parameterBindingMap.values() ) {
final MappingModelExpressable<?> mappingType = determineMappingType( binding, persistenceContext );
assert mappingType instanceof JavaTypedExpressable;
final MappingModelExpressible<?> mappingType = determineMappingType( binding, persistenceContext );
assert mappingType instanceof JavaTypedExpressible;
//noinspection unchecked
final JavaType<Object> javaType = ( (JavaTypedExpressable<Object>) mappingType ).getExpressableJavaType();
final JavaType<Object> javaType = ( (JavaTypedExpressible<Object>) mappingType ).getExpressibleJavaType();
if ( binding.isMultiValued() ) {
for ( Object bindValue : binding.getBindValues() ) {
@ -206,11 +206,11 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
return new ParameterBindingsMementoImpl( allBindValues.toArray( new Object[0] ), hashCode );
}
private MappingModelExpressable<?> determineMappingType(QueryParameterBinding<?> binding, SharedSessionContractImplementor session) {
private MappingModelExpressible<?> determineMappingType(QueryParameterBinding<?> binding, SharedSessionContractImplementor session) {
if ( binding.getBindType() != null ) {
if ( binding.getBindType() instanceof MappingModelExpressable ) {
if ( binding.getBindType() instanceof MappingModelExpressible) {
//noinspection unchecked
return (MappingModelExpressable<Object>) binding.getBindType();
return (MappingModelExpressible<Object>) binding.getBindType();
}
}
@ -220,9 +220,9 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
final TypeConfiguration typeConfiguration = session.getFactory().getTypeConfiguration();
if ( binding.getBindType() instanceof JavaTypedExpressable ) {
final JavaTypedExpressable<?> javaTypedExpressable = (JavaTypedExpressable<?>) binding.getBindType();
final JavaType<?> jtd = javaTypedExpressable.getExpressableJavaType();
if ( binding.getBindType() instanceof JavaTypedExpressible) {
final JavaTypedExpressible<?> javaTypedExpressible = (JavaTypedExpressible<?>) binding.getBindType();
final JavaType<?> jtd = javaTypedExpressible.getExpressibleJavaType();
if ( jtd.getJavaTypeClass() != null ) {
// avoid dynamic models
return typeConfiguration.getBasicTypeForJavaType( jtd.getJavaTypeClass() );

View File

@ -9,7 +9,7 @@ package org.hibernate.query.results;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.metamodel.mapping.BasicValuedMapping;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.sql.ast.SqlAstWalker;
import org.hibernate.sql.ast.spi.SqlExpressionAccess;
import org.hibernate.sql.ast.spi.SqlSelection;
@ -77,7 +77,7 @@ public class ResultSetMappingSqlSelection implements SqlSelection, Expression, S
}
@Override
public MappingModelExpressable getExpressionType() {
public MappingModelExpressible getExpressionType() {
return valueMapping;
}

View File

@ -47,7 +47,7 @@ public class CompleteResultBuilderBasicModelPart
@Override
public Class<?> getJavaType() {
return modelPart.getExpressableJavaType().getJavaTypeClass();
return modelPart.getExpressibleJavaType().getJavaTypeClass();
}
@Override

View File

@ -110,7 +110,7 @@ public class CompleteResultBuilderBasicValuedConverted<O,R> implements CompleteR
// return new SqlSelectionImpl( valuesArrayPosition, basicType );
// }
// ),
// basicType.getExpressableJavaType(),
// basicType.getExpressibleJavaType(),
// sessionFactory.getTypeConfiguration()
// );

View File

@ -104,7 +104,7 @@ public class CompleteResultBuilderBasicValuedStandard implements CompleteResultB
// return new SqlSelectionImpl( valuesArrayPosition, basicType );
// }
// ),
// basicType.getExpressableJavaType(),
// basicType.getExpressibleJavaType(),
// sessionFactory.getTypeConfiguration()
// );

View File

@ -68,7 +68,7 @@ public class CompleteResultBuilderCollectionStandard implements CompleteResultBu
@Override
public Class<?> getJavaType() {
return pluralAttributeDescriptor.getExpressableJavaType().getJavaTypeClass();
return pluralAttributeDescriptor.getExpressibleJavaType().getJavaTypeClass();
}
@Override

View File

@ -57,7 +57,7 @@ public class DynamicResultBuilderAttribute implements DynamicResultBuilder, Nati
@Override
public Class<?> getJavaType() {
return attributeMapping.getExpressableJavaType().getJavaTypeClass();
return attributeMapping.getExpressibleJavaType().getJavaTypeClass();
}
@Override

View File

@ -35,7 +35,7 @@ public class ImplicitModelPartResultBuilderBasic
@Override
public Class<?> getJavaType() {
return modelPart.getExpressableJavaType().getJavaTypeClass();
return modelPart.getExpressibleJavaType().getJavaTypeClass();
}
@Override

View File

@ -45,7 +45,7 @@ import org.hibernate.query.TupleTransformer;
import org.hibernate.query.TypedParameterValue;
import org.hibernate.query.criteria.JpaExpression;
import org.hibernate.query.internal.QueryOptionsImpl;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.tree.expression.SqmLiteral;
import org.hibernate.query.sqm.tree.expression.SqmParameter;
import org.hibernate.query.sqm.tree.select.SqmSelectStatement;
@ -862,10 +862,10 @@ public abstract class AbstractCommonQueryContract implements CommonQueryContract
private boolean isInstance(BindableType<?> parameterType, Object value) {
final SqmExpressable<?> sqmExpressable = parameterType.resolveExpressable( getSession().getFactory() );
assert sqmExpressable != null;
final SqmExpressible<?> sqmExpressible = parameterType.resolveExpressible( getSession().getFactory() );
assert sqmExpressible != null;
return sqmExpressable.getExpressableJavaType().isInstance( value );
return sqmExpressible.getExpressibleJavaType().isInstance( value );
}
@Override

View File

@ -49,7 +49,7 @@ import org.hibernate.query.TupleTransformer;
import org.hibernate.query.TypedParameterValue;
import org.hibernate.query.internal.ScrollableResultsIterator;
import org.hibernate.query.named.NamedQueryMemento;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.type.BasicType;
import org.hibernate.type.descriptor.java.JavaType;
@ -635,10 +635,10 @@ public abstract class AbstractQuery<R>
}
private boolean isInstance(BindableType<?> parameterType, Object value) {
final SqmExpressable<?> sqmExpressable = parameterType.resolveExpressable( getSession().getFactory() );
assert sqmExpressable != null;
final SqmExpressible<?> sqmExpressible = parameterType.resolveExpressible( getSession().getFactory() );
assert sqmExpressible != null;
return sqmExpressable.getExpressableJavaType().isInstance( value );
return sqmExpressible.getExpressibleJavaType().isInstance( value );
}
@Override

View File

@ -10,7 +10,7 @@ import java.util.Collection;
import jakarta.persistence.TemporalType;
import org.hibernate.Incubating;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.BindableType;
import org.hibernate.type.spi.TypeConfiguration;
@ -111,17 +111,17 @@ public interface QueryParameterBinding<T> {
Collection<? extends T> getBindValues();
/**
* Returns the inferred mapping model expressable i.e. the model reference against which this parameter is compared.
* Returns the inferred mapping model expressible i.e. the model reference against which this parameter is compared.
*
* @return the inferred mapping model expressable or <code>null</code>
* @return the inferred mapping model expressible or <code>null</code>
*/
MappingModelExpressable<T> getType();
MappingModelExpressible<T> getType();
/**
* Sets the mapping model expressable for this parameter.
* Sets the mapping model expressible for this parameter.
*
* @param type The mapping model expressable
* @param type The mapping model expressible
* @return Whether the bind type was changed
*/
boolean setType(MappingModelExpressable<T> type);
boolean setType(MappingModelExpressible<T> type);
}

View File

@ -12,7 +12,7 @@ import java.util.Date;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.query.BindableType;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter;
import org.hibernate.type.descriptor.java.JavaType;
@ -56,8 +56,8 @@ public class QueryParameterBindingValidator {
parameterJavaType = paramType.getBindableJavaType();
}
else {
final SqmExpressable<?> sqmExpressable = paramType.resolveExpressable( sessionFactory );
parameterJavaType = sqmExpressable.getBindableJavaType();
final SqmExpressible<?> sqmExpressible = paramType.resolveExpressible( sessionFactory );
parameterJavaType = sqmExpressible.getBindableJavaType();
}
if ( parameterJavaType == null ) {

View File

@ -91,11 +91,11 @@ public interface NodeBuilder extends HibernateCriteriaBuilder {
List<? extends SqmExpression<?>> expressions);
<R> SqmTuple<R> tuple(
SqmExpressable<R> tupleType,
SqmExpressible<R> tupleType,
SqmExpression<?>... expressions);
<R> SqmTuple<R> tuple(
SqmExpressable<R> tupleType,
SqmExpressible<R> tupleType,
List<? extends SqmExpression<?>> expressions);
@Override

View File

@ -19,14 +19,14 @@ import org.hibernate.type.descriptor.java.JavaType;
*
* @author Steve Ebersole
*/
public interface SqmExpressable<J> extends BindableType<J> {
public interface SqmExpressible<J> extends BindableType<J> {
/**
* The Java type descriptor for this expressable
* The Java type descriptor for this expressible
*/
JavaType<J> getExpressableJavaType();
JavaType<J> getExpressibleJavaType();
@Override
default SqmExpressable<J> resolveExpressable(SessionFactoryImplementor sessionFactory) {
default SqmExpressible<J> resolveExpressible(SessionFactoryImplementor sessionFactory) {
return this;
}
}

View File

@ -13,7 +13,7 @@ import jakarta.persistence.metamodel.Bindable;
import org.hibernate.metamodel.model.domain.DomainType;
import org.hibernate.query.SemanticException;
import org.hibernate.query.spi.NavigablePath;
import org.hibernate.query.sqm.tree.SqmExpressableAccessor;
import org.hibernate.query.sqm.tree.SqmExpressibleAccessor;
import org.hibernate.query.sqm.tree.domain.SqmPath;
/**
@ -25,7 +25,7 @@ import org.hibernate.query.sqm.tree.domain.SqmPath;
*
* @author Steve Ebersole
*/
public interface SqmPathSource<J> extends SqmExpressable<J>, Bindable<J>, SqmExpressableAccessor<J> {
public interface SqmPathSource<J> extends SqmExpressible<J>, Bindable<J>, SqmExpressibleAccessor<J> {
/**
* The name of this thing. Mainly used in logging and when creating a
* {@link NavigablePath}
@ -62,7 +62,7 @@ public interface SqmPathSource<J> extends SqmExpressable<J>, Bindable<J>, SqmExp
Locale.ROOT,
"Could not resolve attribute '%s' of '%s'",
name,
getExpressable().getExpressableJavaType().getJavaType().getTypeName()
getExpressible().getExpressibleJavaType().getJavaType().getTypeName()
)
)
);
@ -83,7 +83,7 @@ public interface SqmPathSource<J> extends SqmExpressable<J>, Bindable<J>, SqmExp
SqmPath<J> createSqmPath(SqmPath<?> lhs, SqmPathSource<?> intermediatePathSource);
@Override
default SqmExpressable<J> getExpressable() {
return (SqmExpressable<J>) getSqmPathType();
default SqmExpressible<J> getExpressible() {
return (SqmExpressible<J>) getSqmPathType();
}
}

View File

@ -34,8 +34,8 @@ public class SelfRenderingAggregateFunctionSqlAstExpression extends SelfRenderin
List<? extends SqlAstNode> sqlAstArguments,
Predicate filter,
ReturnableType<?> type,
JdbcMappingContainer expressable) {
super( functionName, renderer, sqlAstArguments, type, expressable );
JdbcMappingContainer expressible) {
super( functionName, renderer, sqlAstArguments, type, expressible );
this.filter = filter;
}

View File

@ -16,7 +16,7 @@ import org.hibernate.mapping.Selectable;
import org.hibernate.mapping.Table;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.JdbcMappingContainer;
import org.hibernate.metamodel.mapping.SqlExpressable;
import org.hibernate.metamodel.mapping.SqlExpressible;
import org.hibernate.query.ReturnableType;
import org.hibernate.query.sqm.sql.internal.DomainResultProducer;
import org.hibernate.sql.ast.SqlAstTranslator;
@ -41,25 +41,25 @@ import org.hibernate.type.spi.TypeConfiguration;
* @author Steve Ebersole
*/
public class SelfRenderingFunctionSqlAstExpression
implements SelfRenderingExpression, Selectable, SqlExpressable, DomainResultProducer, FunctionExpression {
implements SelfRenderingExpression, Selectable, SqlExpressible, DomainResultProducer, FunctionExpression {
private final String functionName;
private final FunctionRenderingSupport renderer;
private final List<? extends SqlAstNode> sqlAstArguments;
private final ReturnableType<?> type;
private final JdbcMappingContainer expressable;
private final JdbcMappingContainer expressible;
public SelfRenderingFunctionSqlAstExpression(
String functionName,
FunctionRenderingSupport renderer,
List<? extends SqlAstNode> sqlAstArguments,
ReturnableType<?> type,
JdbcMappingContainer expressable) {
JdbcMappingContainer expressible) {
this.functionName = functionName;
this.renderer = renderer;
this.sqlAstArguments = sqlAstArguments;
this.type = type;
//might be null due to code in SelfRenderingFunctionSqlAstExpression
this.expressable = expressable;
this.expressible = expressible;
}
@Override
@ -74,10 +74,10 @@ public class SelfRenderingFunctionSqlAstExpression
@Override
public JdbcMappingContainer getExpressionType() {
if ( type instanceof SqlExpressable ) {
if ( type instanceof SqlExpressible) {
return (JdbcMappingContainer) type;
}
return expressable;
return expressible;
}
protected FunctionRenderingSupport getRenderer() {
@ -105,13 +105,13 @@ public class SelfRenderingFunctionSqlAstExpression
creationState.getSqlAstCreationState().getSqlExpressionResolver()
.resolveSqlSelection(
this,
type.getExpressableJavaType(),
type.getExpressibleJavaType(),
creationState.getSqlAstCreationState().getCreationContext()
.getDomainModel().getTypeConfiguration()
)
.getValuesArrayPosition(),
resultVariable,
type.getExpressableJavaType()
type.getExpressibleJavaType()
);
}
@ -165,11 +165,11 @@ public class SelfRenderingFunctionSqlAstExpression
@Override
public JdbcMapping getJdbcMapping() {
if ( type instanceof SqlExpressable ) {
return ( (SqlExpressable) type ).getJdbcMapping();
if ( type instanceof SqlExpressible) {
return ( (SqlExpressible) type ).getJdbcMapping();
}
else {
return ( (SqlExpressable) expressable ).getJdbcMapping();
return ( (SqlExpressible) expressible).getJdbcMapping();
}
}
@ -180,7 +180,7 @@ public class SelfRenderingFunctionSqlAstExpression
sqlExpressionResolver.resolveSqlSelection(
this,
type.getExpressableJavaType(),
type.getExpressibleJavaType(),
sqlAstCreationState.getCreationContext().getDomainModel().getTypeConfiguration()
);
}

View File

@ -60,7 +60,7 @@ public class SelfRenderingSqmAggregateFunction<T> extends SelfRenderingSqmFuncti
resolveSqlAstArguments( getArguments(), walker ),
filter == null ? null : (Predicate) filter.accept( walker ),
resultType,
getMappingModelExpressable( walker, resultType )
getMappingModelExpressible( walker, resultType )
);
}

View File

@ -11,10 +11,10 @@ import java.util.List;
import org.hibernate.metamodel.MappingMetamodel;
import org.hibernate.metamodel.mapping.BasicValuedMapping;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.ReturnableType;
import org.hibernate.query.sqm.NodeBuilder;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.produce.function.ArgumentsValidator;
import org.hibernate.query.sqm.produce.function.FunctionReturnTypeResolver;
import org.hibernate.query.sqm.sql.SqmToSqlAstConverter;
@ -87,14 +87,14 @@ public class SelfRenderingSqmFunction<T> extends SqmFunction<T> {
getRenderingSupport(),
arguments,
resultType,
resultType == null ? null : getMappingModelExpressable( walker, resultType )
resultType == null ? null : getMappingModelExpressible( walker, resultType )
);
}
public SqmExpressable<T> getNodeType() {
SqmExpressable<T> nodeType = super.getNodeType();
public SqmExpressible<T> getNodeType() {
SqmExpressible<T> nodeType = super.getNodeType();
if ( nodeType == null ) {
nodeType = (SqmExpressable<T>) resolveResultType( nodeBuilder().getTypeConfiguration() );
nodeType = (SqmExpressible<T>) resolveResultType( nodeBuilder().getTypeConfiguration() );
}
return nodeType;
@ -107,19 +107,19 @@ public class SelfRenderingSqmFunction<T> extends SqmFunction<T> {
getArguments(),
typeConfiguration
);
setExpressableType( resultType );
setExpressibleType( resultType );
}
return resultType;
}
protected MappingModelExpressable<?> getMappingModelExpressable(
protected MappingModelExpressible<?> getMappingModelExpressible(
SqmToSqlAstConverter walker,
ReturnableType<?> resultType) {
MappingModelExpressable<?> mapping;
if ( resultType instanceof MappingModelExpressable ) {
MappingModelExpressible<?> mapping;
if ( resultType instanceof MappingModelExpressible) {
// here we have a BasicType, which can be cast
// directly to BasicValuedMapping
mapping = (MappingModelExpressable<?>) resultType;
mapping = (MappingModelExpressible<?>) resultType;
}
else {
// here we have something that is not a BasicType,
@ -129,7 +129,7 @@ public class SelfRenderingSqmFunction<T> extends SqmFunction<T> {
() -> {
try {
final MappingMetamodel domainModel = walker.getCreationContext().getDomainModel();
return (BasicValuedMapping) domainModel.resolveMappingExpressable(
return (BasicValuedMapping) domainModel.resolveMappingExpressible(
getNodeType(),
walker.getFromClauseAccess()::getTableGroup
);

View File

@ -22,7 +22,7 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.engine.spi.SubselectFetch;
import org.hibernate.internal.EmptyScrollableResults;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.IllegalQueryOperationException;
import org.hibernate.query.TupleTransformer;
import org.hibernate.query.criteria.JpaSelection;
@ -339,8 +339,8 @@ public class ConcreteSqmSelectQueryPlan<R> implements SelectQueryPlan<R> {
new SqmParameterMappingModelResolutionAccess() {
//this is pretty ugly!
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) sqmInterpretation.getSqmParameterMappingModelTypes().get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) sqmInterpretation.getSqmParameterMappingModelTypes().get(parameter);
}
},
session
@ -390,8 +390,8 @@ public class ConcreteSqmSelectQueryPlan<R> implements SelectQueryPlan<R> {
tableGroupAccess::findTableGroup,
new SqmParameterMappingModelResolutionAccess() {
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) sqmInterpretation.getSqmParameterMappingModelTypeResolutions().get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) sqmInterpretation.getSqmParameterMappingModelTypeResolutions().get(parameter);
}
},
session
@ -421,7 +421,7 @@ public class ConcreteSqmSelectQueryPlan<R> implements SelectQueryPlan<R> {
private final JdbcSelect jdbcSelect;
private final FromClauseAccess tableGroupAccess;
private final Map<QueryParameterImplementor<?>, Map<SqmParameter<?>, List<List<JdbcParameter>>>> jdbcParamsXref;
private final Map<SqmParameter<?>, MappingModelExpressable<?>> sqmParameterMappingModelTypes;
private final Map<SqmParameter<?>, MappingModelExpressible<?>> sqmParameterMappingModelTypes;
private transient JdbcParameterBindings firstParameterBindings;
CacheableSqmInterpretation(
@ -429,7 +429,7 @@ public class ConcreteSqmSelectQueryPlan<R> implements SelectQueryPlan<R> {
JdbcSelect jdbcSelect,
FromClauseAccess tableGroupAccess,
Map<QueryParameterImplementor<?>, Map<SqmParameter<?>, List<List<JdbcParameter>>>> jdbcParamsXref,
Map<SqmParameter<?>,MappingModelExpressable<?>> sqmParameterMappingModelTypes,
Map<SqmParameter<?>, MappingModelExpressible<?>> sqmParameterMappingModelTypes,
JdbcParameterBindings firstParameterBindings) {
this.selectStatement = selectStatement;
this.jdbcSelect = jdbcSelect;
@ -455,7 +455,7 @@ public class ConcreteSqmSelectQueryPlan<R> implements SelectQueryPlan<R> {
return jdbcParamsXref;
}
public Map<SqmParameter<?>, MappingModelExpressable<?>> getSqmParameterMappingModelTypes() {
public Map<SqmParameter<?>, MappingModelExpressible<?>> getSqmParameterMappingModelTypes() {
return sqmParameterMappingModelTypes;
}

View File

@ -74,7 +74,7 @@ import org.hibernate.query.spi.QueryParameterBindings;
import org.hibernate.query.spi.QueryParameterImplementor;
import org.hibernate.query.spi.ScrollableResultsImplementor;
import org.hibernate.query.spi.SelectQueryPlan;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.SqmPathSource;
import org.hibernate.query.sqm.internal.SqmInterpretationsKey.InterpretationsKeySource;
import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy;
@ -372,7 +372,7 @@ public class QuerySqmImpl<R>
final SqmParameter<?> sqmParameter = (SqmParameter<?>) sqmSelection.getSelectableNode();
// we may not yet know a selection type
if ( sqmParameter.getNodeType() == null || sqmParameter.getNodeType().getExpressableJavaType() == null ) {
if ( sqmParameter.getNodeType() == null || sqmParameter.getNodeType().getExpressibleJavaType() == null ) {
// we can't verify the result type up front
return;
}
@ -384,22 +384,22 @@ public class QuerySqmImpl<R>
private static <T> void verifyResultType(
Class<T> resultClass,
SqmExpressable<?> sqmExpressable,
SqmExpressible<?> sqmExpressible,
SessionFactoryImplementor sessionFactory) {
assert sqmExpressable != null;
assert sqmExpressable.getExpressableJavaType() != null;
assert sqmExpressible != null;
assert sqmExpressible.getExpressibleJavaType() != null;
final Class<?> javaTypeClass = sqmExpressable.getExpressableJavaType().getJavaTypeClass();
final Class<?> javaTypeClass = sqmExpressible.getExpressibleJavaType().getJavaTypeClass();
if ( ! resultClass.isAssignableFrom( javaTypeClass ) ) {
// Special case for date because we always report java.util.Date as expression type
// But the expected resultClass could be a subtype of that, so we need to check the JdbcType
if ( javaTypeClass == Date.class ) {
JdbcType jdbcType = null;
if ( sqmExpressable instanceof BasicDomainType<?> ) {
jdbcType = ( (BasicDomainType<?>) sqmExpressable ).getJdbcType();
if ( sqmExpressible instanceof BasicDomainType<?> ) {
jdbcType = ( (BasicDomainType<?>) sqmExpressible).getJdbcType();
}
else if ( sqmExpressable instanceof SqmPathSource<?> ) {
final DomainType<?> domainType = ( (SqmPathSource<?>) sqmExpressable ).getSqmPathType();
else if ( sqmExpressible instanceof SqmPathSource<?> ) {
final DomainType<?> domainType = ( (SqmPathSource<?>) sqmExpressible).getSqmPathType();
if ( domainType instanceof BasicDomainType<?> ) {
jdbcType = ( (BasicDomainType<?>) domainType ).getJdbcType();
}
@ -427,7 +427,7 @@ public class QuerySqmImpl<R>
final String errorMessage = String.format(
"Specified result type [%s] did not match Query selection type [%s] - multiple selections: use Tuple or array",
resultClass.getName(),
sqmExpressable.getExpressableJavaType().getJavaType().getTypeName()
sqmExpressible.getExpressibleJavaType().getJavaType().getTypeName()
);
if ( sessionFactory.getSessionFactoryOptions().getJpaCompliance().isJpaQueryComplianceEnabled() ) {

View File

@ -15,7 +15,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.MappingModelHelper;
import org.hibernate.query.spi.NavigablePath;
import org.hibernate.query.spi.DomainQueryExecutionContext;
@ -107,8 +107,8 @@ public class SimpleDeleteQueryPlan implements NonSelectQueryPlan {
sqmInterpretation.getFromClauseAccess()::findTableGroup,
new SqmParameterMappingModelResolutionAccess() {
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) sqmInterpretation.getSqmParameterMappingModelTypeResolutions().get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) sqmInterpretation.getSqmParameterMappingModelTypeResolutions().get(parameter);
}
},
session

View File

@ -13,7 +13,7 @@ import org.hibernate.action.internal.BulkOperationCleanupAction;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.spi.DomainQueryExecutionContext;
import org.hibernate.query.spi.NonSelectQueryPlan;
import org.hibernate.query.spi.QueryEngine;
@ -37,7 +37,7 @@ import org.hibernate.sql.exec.spi.JdbcParameterBindings;
public class SimpleInsertQueryPlan implements NonSelectQueryPlan {
private final SqmInsertStatement<?> sqmInsert;
private final DomainParameterXref domainParameterXref;
private Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions;
private Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions;
private JdbcInsert jdbcInsert;
private FromClauseAccess tableGroupAccess;
@ -100,8 +100,8 @@ public class SimpleInsertQueryPlan implements NonSelectQueryPlan {
tableGroupAccess::findTableGroup,
new SqmParameterMappingModelResolutionAccess() {
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) paramTypeResolutions.get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) paramTypeResolutions.get(parameter);
}
},
session

View File

@ -13,7 +13,7 @@ import org.hibernate.action.internal.BulkOperationCleanupAction;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.spi.DomainQueryExecutionContext;
import org.hibernate.query.spi.NonSelectQueryPlan;
import org.hibernate.query.spi.QueryEngine;
@ -41,7 +41,7 @@ public class SimpleUpdateQueryPlan implements NonSelectQueryPlan {
private JdbcUpdate jdbcUpdate;
private FromClauseAccess tableGroupAccess;
private Map<QueryParameterImplementor<?>, Map<SqmParameter<?>, List<List<JdbcParameter>>>> jdbcParamsXref;
private Map<SqmParameter<?>,MappingModelExpressable<?>> sqmParamMappingTypeResolutions;
private Map<SqmParameter<?>, MappingModelExpressible<?>> sqmParamMappingTypeResolutions;
public SimpleUpdateQueryPlan(
SqmUpdateStatement<?> sqmUpdate,
@ -69,8 +69,8 @@ public class SimpleUpdateQueryPlan implements NonSelectQueryPlan {
tableGroupAccess::findTableGroup,
new SqmParameterMappingModelResolutionAccess() {
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) sqmParamMappingTypeResolutions.get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) sqmParamMappingTypeResolutions.get(parameter);
}
},
session

View File

@ -55,7 +55,7 @@ import org.hibernate.query.criteria.JpaSelection;
import org.hibernate.query.criteria.ValueHandlingMode;
import org.hibernate.query.spi.QueryEngine;
import org.hibernate.query.sqm.NodeBuilder;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.SqmQuerySource;
import org.hibernate.query.sqm.function.NamedSqmFunctionDescriptor;
import org.hibernate.query.sqm.function.SqmFunctionDescriptor;
@ -449,24 +449,24 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
final TypeConfiguration typeConfiguration = getTypeConfiguration();
@SuppressWarnings("unchecked")
final List<SqmExpression<?>> sqmExpressions = (List<SqmExpression<?>>) expressions;
final SqmExpressable<R> expressableType;
final SqmExpressible<R> expressibleType;
if ( tupleType == null || tupleType == Object[].class ) {
//noinspection unchecked
expressableType = (DomainType<R>) typeConfiguration.resolveTupleType( sqmExpressions );
expressibleType = (DomainType<R>) typeConfiguration.resolveTupleType( sqmExpressions );
}
else {
expressableType = typeConfiguration.getSessionFactory().getMetamodel().embeddable( tupleType );
expressibleType = typeConfiguration.getSessionFactory().getMetamodel().embeddable( tupleType );
}
return tuple( expressableType, sqmExpressions );
return tuple( expressibleType, sqmExpressions );
}
@Override
public <R> SqmTuple<R> tuple(SqmExpressable<R> tupleType, SqmExpression<?>... expressions) {
public <R> SqmTuple<R> tuple(SqmExpressible<R> tupleType, SqmExpression<?>... expressions) {
return tuple( tupleType, asList( expressions ) );
}
@Override
public <R> SqmTuple<R> tuple(SqmExpressable<R> tupleType, List<? extends SqmExpression<?>> sqmExpressions) {
public <R> SqmTuple<R> tuple(SqmExpressible<R> tupleType, List<? extends SqmExpression<?>> sqmExpressions) {
if ( tupleType == null ) {
//noinspection unchecked
tupleType = (DomainType<R>) getTypeConfiguration().resolveTupleType( sqmExpressions );
@ -704,7 +704,7 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
operator,
leftHandExpression,
rightHandExpression,
(SqmExpressable<N>) getDomainModel().getTypeConfiguration().resolveArithmeticType(
(SqmExpressible<N>) getDomainModel().getTypeConfiguration().resolveArithmeticType(
leftHandExpression.getNodeType(),
rightHandExpression.getNodeType(),
operator
@ -891,17 +891,17 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
return new SqmLiteralNull<>( this );
}
final SqmExpressable<T> expressible = resolveInferredType( value, typeInferenceSource, getTypeConfiguration() );
final SqmExpressible<T> expressible = resolveInferredType( value, typeInferenceSource, getTypeConfiguration() );
return new SqmLiteral<>( value, expressible, this );
}
private static <T> SqmExpressable<T> resolveInferredType(
private static <T> SqmExpressible<T> resolveInferredType(
T value,
SqmExpression<? extends T> typeInferenceSource,
TypeConfiguration typeConfiguration) {
if ( typeInferenceSource != null ) {
//noinspection unchecked
return (SqmExpressable<T>) typeInferenceSource.getNodeType();
return (SqmExpressible<T>) typeInferenceSource.getNodeType();
}
if ( value == null ) {
@ -924,11 +924,11 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
final BindableType<? extends T> valueParamType = queryEngine.getTypeConfiguration()
.getSessionFactory()
.resolveParameterBindType( value );
final SqmExpressable<? extends T> sqmExpressable = valueParamType == null
final SqmExpressible<? extends T> sqmExpressible = valueParamType == null
? null
: valueParamType.resolveExpressable( getTypeConfiguration().getSessionFactory() );
: valueParamType.resolveExpressible( getTypeConfiguration().getSessionFactory() );
return new SqmLiteral<>( value, sqmExpressable, this );
return new SqmLiteral<>( value, sqmExpressible, this );
}
@Override
@ -961,19 +961,19 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
public <T> SqmExpression<T> nullLiteral(Class<T> resultClass) {
final TypeConfiguration typeConfiguration = getTypeConfiguration();
final BasicType<T> basicTypeForJavaType = typeConfiguration.getBasicTypeForJavaType( resultClass );
final SqmExpressable<T> sqmExpressable;
final SqmExpressible<T> sqmExpressible;
if ( basicTypeForJavaType == null ) {
sqmExpressable = typeConfiguration.getSessionFactory()
sqmExpressible = typeConfiguration.getSessionFactory()
.getMetamodel()
.managedType( resultClass );
}
else {
sqmExpressable = basicTypeForJavaType;
sqmExpressible = basicTypeForJavaType;
}
return new SqmLiteralNull<>( sqmExpressable, this );
return new SqmLiteralNull<>(sqmExpressible, this );
}
class MultiValueParameterType<T> implements SqmExpressable<T> {
class MultiValueParameterType<T> implements SqmExpressible<T> {
private final JavaType<T> javaType;
public MultiValueParameterType(Class<T> type) {
@ -984,7 +984,7 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
}
@Override
public JavaType<T> getExpressableJavaType() {
public JavaType<T> getExpressibleJavaType() {
return javaType;
}
@ -1501,12 +1501,12 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
@Override
public <Y> JpaCoalesce<Y> coalesce(Expression<? extends Y> x, Expression<? extends Y> y) {
@SuppressWarnings("unchecked")
final SqmExpressable<Y> sqmExpressable = (SqmExpressable<Y>) highestPrecedenceType(
final SqmExpressible<Y> sqmExpressible = (SqmExpressible<Y>) highestPrecedenceType(
( (SqmExpression<? extends Y>) x ).getNodeType(),
( (SqmExpression<? extends Y>) y ).getNodeType()
);
return new SqmCoalesce<>(
sqmExpressable,
sqmExpressible,
2,
this
)

View File

@ -12,7 +12,7 @@ import jakarta.persistence.metamodel.Bindable;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.metamodel.mapping.CollectionPart;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.ModelPart;
import org.hibernate.metamodel.mapping.ModelPartContainer;
import org.hibernate.metamodel.model.domain.AnyMappingDomainType;
@ -27,7 +27,7 @@ import org.hibernate.metamodel.model.domain.internal.EntitySqmPathSource;
import org.hibernate.metamodel.MappingMetamodel;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.query.spi.NavigablePath;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.SqmPathSource;
import org.hibernate.query.sqm.sql.SqmToSqlAstConverter;
import org.hibernate.query.sqm.tree.SqmTypedNode;
@ -112,17 +112,17 @@ public class SqmMappingModelHelper {
);
}
public static MappingModelExpressable resolveMappingModelExpressable(
public static MappingModelExpressible<?> resolveMappingModelExpressible(
SqmTypedNode<?> sqmNode,
MappingMetamodel domainModel,
Function<NavigablePath,TableGroup> tableGroupLocator) {
if ( sqmNode instanceof SqmPath ) {
return resolveSqmPath( (SqmPath) sqmNode, domainModel, tableGroupLocator );
return resolveSqmPath( (SqmPath<?>) sqmNode, domainModel, tableGroupLocator );
}
final SqmExpressable<?> nodeType = sqmNode.getNodeType();
final SqmExpressible<?> nodeType = sqmNode.getNodeType();
if ( nodeType instanceof BasicType ) {
return ( (BasicType) nodeType );
return (BasicType<?>) nodeType;
}
return null;

View File

@ -29,7 +29,7 @@ import org.hibernate.metamodel.mapping.ConvertibleModelPart;
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.PluralAttributeMapping;
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
@ -221,14 +221,14 @@ public class SqmUtil {
continue;
}
if ( !domainParamBinding.isBound() ) {
final MappingModelExpressable<?> mappingExpressable = SqmMappingModelHelper.resolveMappingModelExpressable(
final MappingModelExpressible<?> mappingExpressible = SqmMappingModelHelper.resolveMappingModelExpressible(
sqmParameter,
domainModel,
tableGroupLocator
);
for ( int i = 0; i < jdbcParamsBinds.size(); i++ ) {
final List<JdbcParameter> jdbcParams = jdbcParamsBinds.get( i );
mappingExpressable.forEachJdbcType(
mappingExpressible.forEachJdbcType(
(position, jdbcType) -> {
jdbcParameterBindings.addBinding(
jdbcParams.get( position ),
@ -420,7 +420,7 @@ public class SqmUtil {
}
for ( int i = 0; i < sqmParameters.size(); i++ ) {
final MappingModelExpressable<?> mappingModelType = mappingModelResolutionAccess
final MappingModelExpressible<?> mappingModelType = mappingModelResolutionAccess
.getResolvedMappingModelType( sqmParameters.get( i ) );
if ( mappingModelType != null ) {
return mappingModelType;

View File

@ -19,7 +19,7 @@ import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.PluralAttributeMapping;
import org.hibernate.metamodel.model.domain.EntityDomainType;
import org.hibernate.query.spi.DomainQueryExecutionContext;
@ -288,8 +288,8 @@ public class MatchingIdSelectionHelper {
navigablePath -> sqmConverter.getMutatingTableGroup(),
new SqmParameterMappingModelResolutionAccess() {
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) sqmConverter.getSqmParameterMappingModelExpressableResolutions().get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) sqmConverter.getSqmParameterMappingModelExpressibleResolutions().get(parameter);
}
}
,

View File

@ -14,7 +14,7 @@ import java.util.function.Function;
import org.hibernate.engine.spi.LoadQueryInfluencers;
import org.hibernate.internal.util.collections.Stack;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.query.spi.QueryOptions;
import org.hibernate.query.spi.QueryParameterBindings;
@ -57,7 +57,7 @@ import org.hibernate.sql.ast.tree.update.Assignment;
*/
public class MultiTableSqmMutationConverter extends BaseSqmToSqlAstConverter<Statement> {
public interface SqmParameterResolutionConsumer {
void accept(SqmParameter<?> sqmParam, MappingModelExpressable<?> mappingType, List<JdbcParameter> jdbcParameters);
void accept(SqmParameter<?> sqmParam, MappingModelExpressible<?> mappingType, List<JdbcParameter> jdbcParameters);
}
private final EntityMappingType mutatingEntityDescriptor;
@ -237,7 +237,7 @@ public class MultiTableSqmMutationConverter extends BaseSqmToSqlAstConverter<Sta
final Expression expression = super.consumeSingleSqmParameter( sqmParameter );
final List<List<JdbcParameter>> jdbcParameters = getJdbcParamsBySqmParam().get( sqmParameter );
final MappingModelExpressable<?> mappingType = getSqmParameterMappingModelExpressableResolutions().get( sqmParameter );
final MappingModelExpressible<?> mappingType = getSqmParameterMappingModelExpressibleResolutions().get( sqmParameter );
parameterResolutionConsumer.accept(
sqmParameter,
mappingType,

View File

@ -19,9 +19,9 @@ import org.hibernate.boot.model.naming.Identifier;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.ModelPart;
import org.hibernate.metamodel.mapping.SqlExpressable;
import org.hibernate.metamodel.mapping.SqlExpressible;
import org.hibernate.query.spi.DomainQueryExecutionContext;
import org.hibernate.query.sqm.internal.DomainParameterXref;
import org.hibernate.query.sqm.internal.SqmJdbcExecutionContextAdapter;
@ -134,7 +134,7 @@ public abstract class AbstractCteMutationHandler extends AbstractMutationHandler
parameterResolutions = new IdentityHashMap<>();
}
final Map<SqmParameter, MappingModelExpressable> paramTypeResolutions = new LinkedHashMap<>();
final Map<SqmParameter, MappingModelExpressible> paramTypeResolutions = new LinkedHashMap<>();
final Predicate restriction = sqmConverter.visitWhereClause(
sqmMutationStatement.getWhereClause(),
@ -172,7 +172,7 @@ public abstract class AbstractCteMutationHandler extends AbstractMutationHandler
new BasicResult<>(
0,
null,
( (SqlExpressable) count).getJdbcMapping().getJavaTypeDescriptor()
( (SqlExpressible) count).getJdbcMapping().getJavaTypeDescriptor()
)
);
querySpec.getSelectClause().addSqlSelection( new SqlSelectionImpl( 1, 0, count ) );

View File

@ -31,8 +31,8 @@ import org.hibernate.metamodel.mapping.BasicValuedMapping;
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.SqlExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.SqlExpressible;
import org.hibernate.persister.entity.AbstractEntityPersister;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.persister.entity.Joinable;
@ -188,7 +188,7 @@ public class CteInsertHandler implements InsertHandler {
final int size = sqmStatement.getInsertionTargetPaths().size();
final List<Map.Entry<SqmCteTableColumn, Assignment>> targetPathColumns = new ArrayList<>( size );
final List<SqmCteTableColumn> targetPathSqmCteColumns = new ArrayList<>( size );
final Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions = new LinkedHashMap<>();
final Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions = new LinkedHashMap<>();
final NamedTableReference entityTableReference = new NamedTableReference(
cteTable.getCteName(),
TemporaryTable.DEFAULT_ALIAS,
@ -632,7 +632,7 @@ public class CteInsertHandler implements InsertHandler {
new BasicResult(
0,
null,
( (SqlExpressable) count).getJdbcMapping().getJavaTypeDescriptor()
( (SqlExpressible) count).getJdbcMapping().getJavaTypeDescriptor()
)
);
querySpec.getSelectClause().addSqlSelection( new SqlSelectionImpl( 1, 0, count ) );
@ -661,8 +661,8 @@ public class CteInsertHandler implements InsertHandler {
navigablePath -> sqmConverter.getMutatingTableGroup(),
new SqmParameterMappingModelResolutionAccess() {
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) paramTypeResolutions.get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) paramTypeResolutions.get(parameter);
}
},
executionContext.getSession()

View File

@ -15,7 +15,7 @@ import java.util.function.BiConsumer;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.persister.entity.Joinable;
import org.hibernate.query.SemanticException;
@ -81,7 +81,7 @@ public class CteUpdateHandler extends AbstractCteMutationHandler implements Upda
// information about the assignments
final SqmSetClause setClause = updateStatement.getSetClause();
final List<Assignment> assignments = new ArrayList<>( setClause.getAssignments().size() );
final Map<SqmParameter, MappingModelExpressable> paramTypeResolutions = new LinkedHashMap<>();
final Map<SqmParameter, MappingModelExpressible> paramTypeResolutions = new LinkedHashMap<>();
sqmConverter.visitSetClause(
setClause,

View File

@ -31,7 +31,7 @@ import org.hibernate.id.insert.InsertGeneratedIdentifierDelegate;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.metamodel.mapping.BasicEntityIdentifierMapping;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.ModelPartContainer;
import org.hibernate.persister.entity.AbstractEntityPersister;
import org.hibernate.query.sqm.ComparisonOperator;
@ -90,7 +90,7 @@ public class InsertExecutionDelegate implements TableBasedInsertHandler.Executio
private final JdbcParameterBindings jdbcParameterBindings;
private final Map<TableReference, List<Assignment>> assignmentsByTable;
private final Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions;
private final Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions;
private final SessionFactoryImplementor sessionFactory;
public InsertExecutionDelegate(
@ -105,7 +105,7 @@ public class InsertExecutionDelegate implements TableBasedInsertHandler.Executio
List<Assignment> assignments,
InsertStatement insertStatement,
Map<SqmParameter<?>, List<List<JdbcParameter>>> parameterResolutions,
Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions,
Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions,
DomainQueryExecutionContext executionContext) {
this.sqmInsert = sqmInsert;
this.sqmConverter = sqmConverter;
@ -137,8 +137,8 @@ public class InsertExecutionDelegate implements TableBasedInsertHandler.Executio
navigablePath -> insertingTableGroup,
new SqmParameterMappingModelResolutionAccess() {
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) paramTypeResolutions.get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) paramTypeResolutions.get(parameter);
}
}
,

View File

@ -26,7 +26,7 @@ import org.hibernate.internal.util.MutableInteger;
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.MappingModelHelper;
import org.hibernate.metamodel.mapping.SelectableConsumer;
import org.hibernate.persister.entity.EntityPersister;
@ -122,7 +122,7 @@ public class RestrictedDeleteExecutionDelegate implements TableBasedDeleteHandle
assert hierarchyRootTableReference != null;
final Map<SqmParameter<?>, List<List<JdbcParameter>>> parameterResolutions;
final Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions;
final Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions;
if ( domainParameterXref.getSqmParameterCount() == 0 ) {
parameterResolutions = Collections.emptyMap();
@ -204,7 +204,7 @@ public class RestrictedDeleteExecutionDelegate implements TableBasedDeleteHandle
Predicate suppliedPredicate,
TableGroup tableGroup,
Map<SqmParameter<?>, List<List<JdbcParameter>>> restrictionSqmParameterResolutions,
Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions,
Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions,
SqlExpressionResolver sqlExpressionResolver,
ExecutionContext executionContext) {
assert entityDescriptor == entityDescriptor.getRootEntityDescriptor();
@ -236,8 +236,8 @@ public class RestrictedDeleteExecutionDelegate implements TableBasedDeleteHandle
navigablePath -> tableGroup,
new SqmParameterMappingModelResolutionAccess() {
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) paramTypeResolutions.get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) paramTypeResolutions.get(parameter);
}
},
executionContext.getSession()
@ -472,7 +472,7 @@ public class RestrictedDeleteExecutionDelegate implements TableBasedDeleteHandle
Predicate predicate,
TableGroup deletingTableGroup,
Map<SqmParameter<?>, List<List<JdbcParameter>>> restrictionSqmParameterResolutions,
Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions,
Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions,
ExecutionContext executionContext) {
final JdbcParameterBindings jdbcParameterBindings = SqmUtil.createJdbcParameterBindings(
executionContext.getQueryParameterBindings(),
@ -485,8 +485,8 @@ public class RestrictedDeleteExecutionDelegate implements TableBasedDeleteHandle
navigablePath -> deletingTableGroup,
new SqmParameterMappingModelResolutionAccess() {
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) paramTypeResolutions.get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) paramTypeResolutions.get(parameter);
}
},
executionContext.getSession()

View File

@ -24,7 +24,7 @@ import org.hibernate.id.OptimizableGenerator;
import org.hibernate.id.enhanced.Optimizer;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.metamodel.MappingMetamodel;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.query.spi.DomainQueryExecutionContext;
import org.hibernate.query.sqm.function.SelfRenderingFunctionSqlAstExpression;
@ -142,7 +142,7 @@ public class TableBasedInsertHandler implements InsertHandler {
// information about the target paths
final List<Assignment> targetPathColumns = new ArrayList<>();
final Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions = new LinkedHashMap<>();
final Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions = new LinkedHashMap<>();
final NamedTableReference entityTableReference = new NamedTableReference(
entityTable.getTableExpression(),
TemporaryTable.DEFAULT_ALIAS,

View File

@ -20,7 +20,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.metamodel.MappingMetamodel;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.persister.entity.Joinable;
import org.hibernate.query.spi.DomainQueryExecutionContext;
@ -144,7 +144,7 @@ public class TableBasedUpdateHandler
// information about the assignments
final List<Assignment> assignments = new ArrayList<>();
final Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions = new LinkedHashMap<>();
final Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions = new LinkedHashMap<>();
converterDelegate.visitSetClause(
getSqmDeleteOrUpdateStatement().getSetClause(),

View File

@ -19,7 +19,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.ModelPartContainer;
import org.hibernate.metamodel.mapping.SelectableConsumer;
import org.hibernate.query.SemanticException;
@ -63,7 +63,7 @@ public class UpdateExecutionDelegate implements TableBasedUpdateHandler.Executio
private final JdbcParameterBindings jdbcParameterBindings;
private final Map<TableReference, List<Assignment>> assignmentsByTable;
private final Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions;
private final Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions;
private final SessionFactoryImplementor sessionFactory;
public UpdateExecutionDelegate(
@ -79,7 +79,7 @@ public class UpdateExecutionDelegate implements TableBasedUpdateHandler.Executio
List<Assignment> assignments,
Predicate suppliedPredicate,
Map<SqmParameter<?>, List<List<JdbcParameter>>> parameterResolutions,
Map<SqmParameter<?>, MappingModelExpressable<?>> paramTypeResolutions,
Map<SqmParameter<?>, MappingModelExpressible<?>> paramTypeResolutions,
DomainQueryExecutionContext executionContext) {
this.sqmUpdate = sqmUpdate;
this.sqmConverter = sqmConverter;
@ -111,8 +111,8 @@ public class UpdateExecutionDelegate implements TableBasedUpdateHandler.Executio
navigablePath -> updatingTableGroup,
new SqmParameterMappingModelResolutionAccess() {
@Override @SuppressWarnings("unchecked")
public <T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressable<T>) paramTypeResolutions.get(parameter);
public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter) {
return (MappingModelExpressible<T>) paramTypeResolutions.get(parameter);
}
},
executionContext.getSession()

View File

@ -10,7 +10,7 @@ import org.hibernate.QueryException;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.JdbcMappingContainer;
import org.hibernate.query.spi.QueryEngine;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.tree.SqmTypedNode;
import org.hibernate.query.sqm.tree.expression.SqmCollation;
import org.hibernate.query.sqm.tree.expression.SqmDurationUnit;
@ -62,10 +62,10 @@ public class ArgumentTypesValidator implements ArgumentsValidator {
int count = 0;
for (SqmTypedNode<?> argument : arguments) {
JdbcTypeIndicators indicators = queryEngine.getTypeConfiguration().getCurrentBaseSqlTypeIndicators();
SqmExpressable<?> nodeType = argument.getNodeType();
SqmExpressible<?> nodeType = argument.getNodeType();
FunctionParameterType type = count < types.length ? types[count++] : types[types.length - 1];
if ( nodeType!=null ) {
JavaType<?> javaType = nodeType.getExpressableJavaType();
JavaType<?> javaType = nodeType.getExpressibleJavaType();
if (javaType != null) {
try {
JdbcType jdbcType = javaType.getRecommendedJdbcType(indicators);

View File

@ -16,7 +16,7 @@ import org.hibernate.metamodel.mapping.BasicValuedMapping;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.JdbcMappingContainer;
import org.hibernate.query.ReturnableType;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.tree.SqmTypedNode;
import org.hibernate.sql.ast.tree.SqlAstNode;
import org.hibernate.sql.ast.tree.expression.Expression;
@ -205,7 +205,7 @@ public class StandardFunctionReturnTypeResolvers {
List<? extends SqmTypedNode<?>> arguments,
int position) {
final SqmTypedNode<?> specifiedArgument = arguments.get( position - 1 );
final SqmExpressable<?> specifiedArgType = specifiedArgument.getNodeType();
final SqmExpressible<?> specifiedArgType = specifiedArgument.getNodeType();
if ( !(specifiedArgType instanceof ReturnableType ) ) {
throw new QueryException(
String.format(
@ -226,13 +226,13 @@ public class StandardFunctionReturnTypeResolvers {
List<? extends SqmTypedNode<?>> arguments,
int position) {
final SqmTypedNode<?> specifiedArgument = arguments.get( position - 1 );
final SqmExpressable<?> specifiedArgType = specifiedArgument.getNodeType();
final SqmExpressible<?> specifiedArgType = specifiedArgument.getNodeType();
if ( specifiedArgType instanceof BasicType<?> ) {
return ( (BasicType<?>) specifiedArgType ).getJdbcMapping();
}
else {
final BasicType<?> basicType = typeConfiguration.getBasicTypeForJavaType(
specifiedArgType.getExpressableJavaType().getJavaTypeClass()
specifiedArgType.getExpressibleJavaType().getJavaTypeClass()
);
if ( basicType == null ) {
throw new QueryException(

View File

@ -6,7 +6,7 @@
*/
package org.hibernate.query.sqm.spi;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.sqm.tree.expression.SqmParameter;
/**
@ -14,5 +14,5 @@ import org.hibernate.query.sqm.tree.expression.SqmParameter;
*/
@FunctionalInterface
public interface SqmParameterMappingModelResolutionAccess {
<T> MappingModelExpressable<T> getResolvedMappingModelType(SqmParameter<T> parameter);
<T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T> parameter);
}

View File

@ -72,11 +72,11 @@ import org.hibernate.metamodel.mapping.EntityVersionMapping;
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.JdbcMappingContainer;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.ModelPart;
import org.hibernate.metamodel.mapping.ModelPartContainer;
import org.hibernate.metamodel.mapping.PluralAttributeMapping;
import org.hibernate.metamodel.mapping.SqlExpressable;
import org.hibernate.metamodel.mapping.SqlExpressible;
import org.hibernate.metamodel.mapping.ValueMapping;
import org.hibernate.metamodel.mapping.internal.EmbeddedCollectionPart;
import org.hibernate.metamodel.mapping.internal.EntityCollectionPart;
@ -111,7 +111,7 @@ import org.hibernate.query.spi.QueryParameterBinding;
import org.hibernate.query.spi.QueryParameterBindings;
import org.hibernate.query.spi.QueryParameterImplementor;
import org.hibernate.query.sqm.InterpretationException;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.SqmPathSource;
import org.hibernate.query.sqm.SqmQuerySource;
import org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor;
@ -387,7 +387,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
private final DomainParameterXref domainParameterXref;
private final QueryParameterBindings domainParameterBindings;
private final Map<SqmParameter<?>,MappingModelExpressable<?>> sqmParameterMappingModelTypes = new LinkedHashMap<>();
private final Map<SqmParameter<?>, MappingModelExpressible<?>> sqmParameterMappingModelTypes = new LinkedHashMap<>();
private final Map<JpaCriteriaParameter<?>, SqmJpaCriteriaParameterWrapper<?>> jpaCriteriaParamResolutions;
private final List<DomainResult<?>> domainResults;
private final EntityGraphTraversalState entityGraphTraversalState;
@ -413,7 +413,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
private SqmByUnit appliedByUnit;
private Expression adjustedTimestamp;
private SqmExpressable<?> adjustedTimestampType; //TODO: remove this once we can get a Type directly from adjustedTimestamp
private SqmExpressible<?> adjustedTimestampType; //TODO: remove this once we can get a Type directly from adjustedTimestamp
private Expression adjustmentScale;
private boolean negativeAdjustment;
@ -475,7 +475,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
.getJpaCriteriaParamResolutions();
}
public Map<SqmParameter<?>,MappingModelExpressable<?>> getSqmParameterMappingModelExpressableResolutions() {
public Map<SqmParameter<?>, MappingModelExpressible<?>> getSqmParameterMappingModelExpressibleResolutions() {
return sqmParameterMappingModelTypes;
}
@ -841,8 +841,8 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
else {
final Expression valueExpression = (Expression) assignmentValue.accept( this );
final int valueExprJdbcCount = getKeyExpressable( valueExpression.getExpressionType() ).getJdbcTypeCount();
final int assignedPathJdbcCount = getKeyExpressable( assignedPathInterpretation.getExpressionType() )
final int valueExprJdbcCount = getKeyExpressible( valueExpression.getExpressionType() ).getJdbcTypeCount();
final int assignedPathJdbcCount = getKeyExpressible( assignedPathInterpretation.getExpressionType() )
.getJdbcTypeCount();
if ( valueExprJdbcCount != assignedPathJdbcCount ) {
@ -3843,7 +3843,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
private Expression createCaseExpression(SqmPath<?> lhs, EntityDomainType<?> treatTarget, Expression expression) {
final BasicValuedMapping mappingModelExpressable = (BasicValuedMapping) expression.getExpressionType();
final BasicValuedMapping mappingModelExpressible = (BasicValuedMapping) expression.getExpressionType();
final List<CaseSearchedExpression.WhenFragment> whenFragments = new ArrayList<>( 1 );
whenFragments.add(
new CaseSearchedExpression.WhenFragment(
@ -3852,9 +3852,9 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
)
);
return new CaseSearchedExpression(
mappingModelExpressable,
mappingModelExpressible,
whenFragments,
new QueryLiteral<>( null, mappingModelExpressable )
new QueryLiteral<>( null, mappingModelExpressible )
);
}
@ -3884,25 +3884,25 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
@Override
public Expression visitLiteral(SqmLiteral<?> literal) {
final Supplier<MappingModelExpressable<?>> inferableTypeAccess = inferrableTypeAccessStack.getCurrent();
final Supplier<MappingModelExpressible<?>> inferableTypeAccess = inferrableTypeAccessStack.getCurrent();
if ( literal instanceof SqmLiteralNull ) {
MappingModelExpressable<?> mappingModelExpressable = inferableTypeAccess.get();
if ( mappingModelExpressable == null ) {
mappingModelExpressable = determineCurrentExpressable( literal );
MappingModelExpressible<?> mappingModelExpressible = inferableTypeAccess.get();
if ( mappingModelExpressible == null ) {
mappingModelExpressible = determineCurrentExpressible( literal );
}
if ( mappingModelExpressable instanceof BasicValuedMapping ) {
return new QueryLiteral<>( null, (BasicValuedMapping) mappingModelExpressable );
if ( mappingModelExpressible instanceof BasicValuedMapping ) {
return new QueryLiteral<>( null, (BasicValuedMapping) mappingModelExpressible);
}
final MappingModelExpressable<?> keyExpressable = getKeyExpressable( mappingModelExpressable );
if ( keyExpressable == null ) {
final MappingModelExpressible<?> keyExpressible = getKeyExpressible(mappingModelExpressible);
if ( keyExpressible == null ) {
// Default to the Object type
return new QueryLiteral<>( null, basicType( Object.class ) );
}
final List<Expression> expressions = new ArrayList<>( keyExpressable.getJdbcTypeCount() );
final List<Expression> expressions = new ArrayList<>( keyExpressible.getJdbcTypeCount() );
keyExpressable.forEachJdbcType(
keyExpressible.forEachJdbcType(
(index, jdbcMapping) -> expressions.add(
new QueryLiteral<>(
null,
@ -3910,13 +3910,13 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
)
)
);
return new SqlTuple( expressions, mappingModelExpressable );
return new SqlTuple( expressions, mappingModelExpressible);
}
final MappingModelExpressable<?> inferableExpressable = inferableTypeAccess.get();
final MappingModelExpressible<?> inferableExpressible = inferableTypeAccess.get();
if ( inferableExpressable instanceof ConvertibleModelPart ) {
final ConvertibleModelPart convertibleModelPart = (ConvertibleModelPart) inferableExpressable;
if ( inferableExpressible instanceof ConvertibleModelPart ) {
final ConvertibleModelPart convertibleModelPart = (ConvertibleModelPart) inferableExpressible;
final BasicValueConverter valueConverter = convertibleModelPart.getValueConverter();
if ( valueConverter != null ) {
@ -3945,8 +3945,8 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
}
// Special case for when we create an entity literal through the JPA CriteriaBuilder.literal API
else if ( inferableExpressable instanceof EntityDiscriminatorMapping ) {
final EntityDiscriminatorMapping discriminatorMapping = (EntityDiscriminatorMapping) inferableExpressable;
else if ( inferableExpressible instanceof EntityDiscriminatorMapping ) {
final EntityDiscriminatorMapping discriminatorMapping = (EntityDiscriminatorMapping) inferableExpressible;
final Object literalValue = literal.getLiteralValue();
final EntityPersister mappingDescriptor;
if ( literalValue instanceof Class<?> ) {
@ -3977,38 +3977,38 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
return new EntityTypeLiteral( mappingDescriptor );
}
final MappingModelExpressable<?> expressable;
final MappingModelExpressable<?> localExpressable = SqmMappingModelHelper.resolveMappingModelExpressable(
final MappingModelExpressible<?> expressible;
final MappingModelExpressible<?> localExpressible = SqmMappingModelHelper.resolveMappingModelExpressible(
literal,
getCreationContext().getDomainModel(),
getFromClauseAccess()::findTableGroup
);
if ( localExpressable == null ) {
expressable = getElementExpressable( inferableExpressable );
if ( localExpressible == null ) {
expressible = getElementExpressible( inferableExpressible );
}
else {
final MappingModelExpressable<?> elementExpressable = getElementExpressable( localExpressable );
if ( elementExpressable instanceof BasicType<?> ) {
expressable = InferredBasicValueResolver.resolveSqlTypeIndicators(
final MappingModelExpressible<?> elementExpressible = getElementExpressible( localExpressible );
if ( elementExpressible instanceof BasicType<?> ) {
expressible = InferredBasicValueResolver.resolveSqlTypeIndicators(
this,
(BasicType<?>) elementExpressable,
(BasicType<?>) elementExpressible,
literal.getJavaTypeDescriptor()
);
}
else {
expressable = elementExpressable;
expressible = elementExpressible;
}
}
if ( expressable instanceof BasicValuedMapping ) {
if ( expressible instanceof BasicValuedMapping ) {
return new QueryLiteral<>(
literal.getLiteralValue(),
(BasicValuedMapping) expressable
(BasicValuedMapping) expressible
);
}
// Handling other values might seem unnecessary, but with JPA Criteria it is totally possible to have such literals
else if ( expressable instanceof EmbeddableValuedModelPart ) {
final EmbeddableValuedModelPart embeddableValuedModelPart = (EmbeddableValuedModelPart) expressable;
else if ( expressible instanceof EmbeddableValuedModelPart ) {
final EmbeddableValuedModelPart embeddableValuedModelPart = (EmbeddableValuedModelPart) expressible;
final List<Expression> list = new ArrayList<>( embeddableValuedModelPart.getJdbcTypeCount() );
embeddableValuedModelPart.forEachJdbcValue(
literal.getLiteralValue(),
@ -4017,10 +4017,10 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
-> list.add( new QueryLiteral<>( value, (BasicValuedMapping) jdbcMapping ) ),
null
);
return new SqlTuple( list, expressable );
return new SqlTuple( list, expressible );
}
else if ( expressable instanceof EntityValuedModelPart ) {
final EntityValuedModelPart entityValuedModelPart = (EntityValuedModelPart) expressable;
else if ( expressible instanceof EntityValuedModelPart ) {
final EntityValuedModelPart entityValuedModelPart = (EntityValuedModelPart) expressible;
final Object associationKey;
final ModelPart associationKeyPart;
if ( entityValuedModelPart instanceof Association ) {
@ -4062,26 +4062,26 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
else {
throw new NotYetImplementedFor6Exception(
expressable == null ? literal.getLiteralValue().getClass() : expressable.getClass()
expressible == null ? literal.getLiteralValue().getClass() : expressible.getClass()
);
}
}
private MappingModelExpressable<?> getKeyExpressable(JdbcMappingContainer mappingModelExpressable) {
if ( mappingModelExpressable instanceof EntityAssociationMapping ) {
return ( (EntityAssociationMapping) mappingModelExpressable ).getKeyTargetMatchPart();
private MappingModelExpressible<?> getKeyExpressible(JdbcMappingContainer mappingModelExpressible) {
if ( mappingModelExpressible instanceof EntityAssociationMapping ) {
return ( (EntityAssociationMapping) mappingModelExpressible ).getKeyTargetMatchPart();
}
else {
return (MappingModelExpressable<?>) mappingModelExpressable;
return (MappingModelExpressible<?>) mappingModelExpressible;
}
}
private MappingModelExpressable<?> getElementExpressable(MappingModelExpressable<?> mappingModelExpressable) {
if ( mappingModelExpressable instanceof PluralAttributeMapping ) {
return ( (PluralAttributeMapping) mappingModelExpressable ).getElementDescriptor();
private MappingModelExpressible<?> getElementExpressible(MappingModelExpressible<?> mappingModelExpressible) {
if ( mappingModelExpressible instanceof PluralAttributeMapping ) {
return ( (PluralAttributeMapping) mappingModelExpressible).getElementDescriptor();
}
else {
return mappingModelExpressable;
return mappingModelExpressible;
}
}
@ -4106,7 +4106,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
protected Expression consumeSqmParameter(
SqmParameter<?> sqmParameter,
MappingModelExpressable<?> valueMapping,
MappingModelExpressible<?> valueMapping,
BiConsumer<Integer, JdbcParameter> jdbcParameterConsumer) {
final List<JdbcParameter> jdbcParametersForSqm = new ArrayList<>();
@ -4145,7 +4145,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
private void replaceJdbcParametersType(
SqmParameter<?> sourceSqmParameter,
List<SqmParameter<?>> sqmParameters,
MappingModelExpressable<?> valueMapping) {
MappingModelExpressible<?> valueMapping) {
final JdbcMapping jdbcMapping = valueMapping.getJdbcMappings().get( 0 );
for ( SqmParameter<?> sqmParameter : sqmParameters ) {
if ( sqmParameter == sourceSqmParameter ) {
@ -4157,7 +4157,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
for ( List<JdbcParameter> parameters : jdbcParamsForSqmParameter ) {
assert parameters.size() == 1;
final JdbcParameter jdbcParameter = parameters.get( 0 );
if ( ( (SqlExpressable) jdbcParameter ).getJdbcMapping() != valueMapping ) {
if ( ( (SqlExpressible) jdbcParameter ).getJdbcMapping() != valueMapping ) {
final JdbcParameter newJdbcParameter = new JdbcParameterImpl( jdbcMapping );
parameters.set( 0, newJdbcParameter );
jdbcParameters.getJdbcParameters().remove( jdbcParameter );
@ -4202,7 +4202,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
protected Expression consumeSingleSqmParameter(SqmParameter<?> sqmParameter) {
final MappingModelExpressable<?> valueMapping = determineValueMapping( sqmParameter );
final MappingModelExpressible<?> valueMapping = determineValueMapping( sqmParameter );
final List<JdbcParameter> jdbcParametersForSqm = new ArrayList<>();
@ -4235,31 +4235,31 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
);
}
// protected MappingModelExpressable<?> lenientlyResolveMappingExpressable(SqmExpressable<?> nodeType) {
// return resolveMappingExpressable( nodeType );
// protected MappingModelExpressible<?> lenientlyResolveMappingExpressible(SqmExpressible<?> nodeType) {
// return resolveMappingExpressible( nodeType );
// }
//
// protected MappingModelExpressable<?> resolveMappingExpressable(SqmExpressable<?> nodeType) {
// final MappingModelExpressable<?> valueMapping = getCreationContext().getDomainModel().resolveMappingExpressable(
// protected MappingModelExpressible<?> resolveMappingExpressible(SqmExpressible<?> nodeType) {
// final MappingModelExpressible<?> valueMapping = getCreationContext().getDomainModel().resolveMappingExpressible(
// nodeType,
// this::findTableGroupByPath
// );
//
// if ( valueMapping == null ) {
// final Supplier<MappingModelExpressable<?>> currentExpressableSupplier = inferrableTypeAccessStack.getCurrent();
// if ( currentExpressableSupplier != null ) {
// return currentExpressableSupplier.get();
// final Supplier<MappingModelExpressible<?>> currentExpressibleSupplier = inferrableTypeAccessStack.getCurrent();
// if ( currentExpressibleSupplier != null ) {
// return currentExpressibleSupplier.get();
// }
// }
//
// if ( valueMapping == null ) {
// throw new ConversionException( "Could not determine ValueMapping for SqmExpressable: " + nodeType );
// throw new ConversionException( "Could not determine ValueMapping for SqmExpressible: " + nodeType );
// }
//
// return valueMapping;
// }
protected MappingModelExpressable<?> determineValueMapping(SqmExpression<?> sqmExpression) {
protected MappingModelExpressible<?> determineValueMapping(SqmExpression<?> sqmExpression) {
if ( sqmExpression instanceof SqmParameter ) {
return determineValueMapping( (SqmParameter<?>) sqmExpression );
}
@ -4268,7 +4268,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
if ( sqmExpression instanceof SqmPath ) {
log.debugf( "Determining mapping-model type for SqmPath : %s ", sqmExpression );
prepareReusablePath( (SqmPath<?>) sqmExpression, () -> null );
return SqmMappingModelHelper.resolveMappingModelExpressable(
return SqmMappingModelHelper.resolveMappingModelExpressible(
sqmExpression,
domainModel,
getFromClauseAccess()::findTableGroup
@ -4277,9 +4277,9 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
// The model type of an enum literal is always inferred
if ( sqmExpression instanceof SqmEnumLiteral<?> ) {
final Supplier<MappingModelExpressable<?>> currentExpressableSupplier = inferrableTypeAccessStack.getCurrent();
if ( currentExpressableSupplier != null ) {
return currentExpressableSupplier.get();
final Supplier<MappingModelExpressible<?>> currentExpressibleSupplier = inferrableTypeAccessStack.getCurrent();
if ( currentExpressibleSupplier != null ) {
return currentExpressibleSupplier.get();
}
}
@ -4288,11 +4288,11 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
final SqmSelectClause selectClause = subQuery.getQuerySpec().getSelectClause();
if ( selectClause.getSelections().size() == 1 ) {
final SqmSelection<?> subQuerySelection = selectClause.getSelections().get( 0 );
final SqmExpressable<?> selectionNodeType = subQuerySelection.getNodeType();
final SqmExpressible<?> selectionNodeType = subQuerySelection.getNodeType();
if ( selectionNodeType != null ) {
final SqmExpressable<?> sqmExpressable;
final SqmExpressible<?> sqmExpressible;
if ( selectionNodeType instanceof PluralPersistentAttribute ) {
sqmExpressable = ( (PluralPersistentAttribute<?,?,?>) selectionNodeType ).getElementPathSource();
sqmExpressible = ( (PluralPersistentAttribute<?,?,?>) selectionNodeType ).getElementPathSource();
}
else if ( selectionNodeType instanceof SqmPathSource<?>) {
final SqmPathSource<?> pathSource = (SqmPathSource<?>) selectionNodeType;
@ -4300,7 +4300,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
pathSource.getPathName()
);
if ( partNature == null ) {
sqmExpressable = selectionNodeType;
sqmExpressible = selectionNodeType;
}
else {
final SqmPath<?> sqmPath = (SqmPath<?>) subQuerySelection.getSelectableNode();
@ -4315,13 +4315,13 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
}
else {
sqmExpressable = selectionNodeType;
sqmExpressible = selectionNodeType;
}
final MappingModelExpressable<?> expressable = domainModel.resolveMappingExpressable( sqmExpressable, this::findTableGroupByPath );
final MappingModelExpressible<?> expressible = domainModel.resolveMappingExpressible(sqmExpressible, this::findTableGroupByPath );
if ( expressable != null ) {
return expressable;
if ( expressible != null ) {
return expressible;
}
try {
@ -4335,20 +4335,20 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
log.debugf( "Determining mapping-model type for generalized SqmExpression : %s", sqmExpression );
final SqmExpressable<?> nodeType = sqmExpression.getNodeType();
final SqmExpressible<?> nodeType = sqmExpression.getNodeType();
if ( nodeType == null ) {
// We can't determine the type of the expression
return null;
}
final MappingModelExpressable<?> valueMapping = domainModel.resolveMappingExpressable(
final MappingModelExpressible<?> valueMapping = domainModel.resolveMappingExpressible(
nodeType,
this::findTableGroupByPath
);
if ( valueMapping == null ) {
final Supplier<MappingModelExpressable<?>> currentExpressableSupplier = inferrableTypeAccessStack.getCurrent();
if ( currentExpressableSupplier != null ) {
return currentExpressableSupplier.get();
final Supplier<MappingModelExpressible<?>> currentExpressibleSupplier = inferrableTypeAccessStack.getCurrent();
if ( currentExpressibleSupplier != null ) {
return currentExpressibleSupplier.get();
}
}
@ -4359,10 +4359,10 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
return valueMapping;
}
protected MappingModelExpressable<?> getInferredValueMapping() {
final Supplier<MappingModelExpressable<?>> currentExpressableSupplier = inferrableTypeAccessStack.getCurrent();
if ( currentExpressableSupplier != null ) {
final MappingModelExpressable<?> inferredMapping = currentExpressableSupplier.get();
protected MappingModelExpressible<?> getInferredValueMapping() {
final Supplier<MappingModelExpressible<?>> currentExpressibleSupplier = inferrableTypeAccessStack.getCurrent();
if ( currentExpressibleSupplier != null ) {
final MappingModelExpressible<?> inferredMapping = currentExpressibleSupplier.get();
if ( inferredMapping != null ) {
if ( inferredMapping instanceof PluralAttributeMapping ) {
return ( (PluralAttributeMapping) inferredMapping ).getElementDescriptor();
@ -4376,7 +4376,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
return null;
}
protected MappingModelExpressable<?> determineValueMapping(SqmParameter<?> sqmParameter) {
protected MappingModelExpressible<?> determineValueMapping(SqmParameter<?> sqmParameter) {
log.debugf( "Determining mapping-model type for SqmParameter : %s", sqmParameter );
final QueryParameterImplementor<?> queryParameter = domainParameterXref.getQueryParameter( sqmParameter );
@ -4386,7 +4386,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
// this should indicate the condition that the user query did not define an
// explicit type in regard to this parameter. Here we should prefer the
// inferrable type and fallback to the binding type
final MappingModelExpressable<?> inferredValueMapping = getInferredValueMapping();
final MappingModelExpressible<?> inferredValueMapping = getInferredValueMapping();
if ( inferredValueMapping != null ) {
return inferredValueMapping;
}
@ -4404,11 +4404,11 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
// Default to the Object type
return basicType( Object.class );
}
else if ( paramType instanceof MappingModelExpressable<?> && paramType.getBindableJavaType() == Object.class ) {
return (MappingModelExpressable<?>) paramType;
else if ( paramType instanceof MappingModelExpressible<?> && paramType.getBindableJavaType() == Object.class ) {
return (MappingModelExpressible<?>) paramType;
}
final SqmExpressable<?> paramSqmType = paramType.resolveExpressable( creationContext.getSessionFactory() );
final SqmExpressible<?> paramSqmType = paramType.resolveExpressible( creationContext.getSessionFactory() );
if ( paramSqmType instanceof SqmPath ) {
final SqmPath<?> sqmPath = (SqmPath<?>) paramSqmType;
@ -4430,7 +4430,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
if ( paramSqmType instanceof CompositeSqmPathSource ) {
// Try to infer the value mapping since the other side apparently is a path source
final MappingModelExpressable<?> inferredValueMapping = getInferredValueMapping();
final MappingModelExpressible<?> inferredValueMapping = getInferredValueMapping();
if ( inferredValueMapping != null ) {
return inferredValueMapping;
}
@ -4439,25 +4439,25 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
if ( paramSqmType instanceof SqmPathSource<?> || paramSqmType instanceof BasicDomainType<?> ) {
// Try to infer the value mapping since the other side apparently is a path source
final MappingModelExpressable<?> inferredValueMapping = getInferredValueMapping();
final MappingModelExpressible<?> inferredValueMapping = getInferredValueMapping();
if ( inferredValueMapping != null ) {
return inferredValueMapping;
}
return getTypeConfiguration().getBasicTypeForJavaType(
paramSqmType.getExpressableJavaType().getJavaTypeClass()
paramSqmType.getExpressibleJavaType().getJavaTypeClass()
);
}
throw new ConversionException( "Could not determine ValueMapping for SqmParameter: " + sqmParameter );
}
protected final Stack<Supplier<MappingModelExpressable<?>>> inferrableTypeAccessStack = new StandardStack<>(
protected final Stack<Supplier<MappingModelExpressible<?>>> inferrableTypeAccessStack = new StandardStack<>(
() -> null
);
private void resolveSqmParameter(
SqmParameter<?> expression,
MappingModelExpressable<?> valueMapping,
MappingModelExpressible<?> valueMapping,
BiConsumer<Integer,JdbcParameter> jdbcParameterConsumer) {
sqmParameterMappingModelTypes.put( expression, valueMapping );
final Bindable bindable;
@ -4512,10 +4512,10 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
final List<SqmExpression<?>> groupedExpressions = sqmTuple.getGroupedExpressions();
final int size = groupedExpressions.size();
final List<Expression> expressions = new ArrayList<>( size );
final MappingModelExpressable<?> mappingModelExpressable = inferrableTypeAccessStack.getCurrent().get();
final MappingModelExpressible<?> mappingModelExpressible = inferrableTypeAccessStack.getCurrent().get();
final EmbeddableMappingType embeddableMappingType;
if ( mappingModelExpressable instanceof ValueMapping ) {
embeddableMappingType = (EmbeddableMappingType) ( (ValueMapping) mappingModelExpressable ).getMappedType();
if ( mappingModelExpressible instanceof ValueMapping ) {
embeddableMappingType = (EmbeddableMappingType) ( (ValueMapping) mappingModelExpressible).getMappedType();
}
else {
embeddableMappingType = null;
@ -4543,14 +4543,14 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
}
}
final MappingModelExpressable<?> valueMapping;
if ( mappingModelExpressable != null ) {
valueMapping = mappingModelExpressable;
final MappingModelExpressible<?> valueMapping;
if ( mappingModelExpressible != null ) {
valueMapping = mappingModelExpressible;
}
else {
final SqmExpressable<?> expressable = sqmTuple.getExpressable();
if ( expressable instanceof MappingModelExpressable<?> ) {
valueMapping = (MappingModelExpressable<?>) expressable;
final SqmExpressible<?> expressible = sqmTuple.getExpressible();
if ( expressible instanceof MappingModelExpressible<?>) {
valueMapping = (MappingModelExpressible<?>) expressible;
}
else {
valueMapping = null;
@ -4687,14 +4687,14 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
private BasicValuedMapping getExpressionType(SqmBinaryArithmetic<?> expression) {
final SqmExpressable<?> nodeType = expression.getNodeType();
final SqmExpressible<?> nodeType = expression.getNodeType();
if ( nodeType != null ) {
if ( nodeType instanceof BasicValuedMapping ) {
return (BasicValuedMapping) nodeType;
}
else {
return getTypeConfiguration().getBasicTypeForJavaType(
nodeType.getExpressableJavaType().getJavaTypeClass()
nodeType.getExpressibleJavaType().getJavaTypeClass()
);
}
}
@ -4738,14 +4738,14 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
// ts - x * (d1 - d2) => (ts - x * d1) + x * d2
Expression timestamp = adjustedTimestamp;
SqmExpressable<?> timestampType = adjustedTimestampType;
SqmExpressible<?> timestampType = adjustedTimestampType;
adjustedTimestamp = toSqlExpression( expression.getLeftHandOperand().accept( this ) );
JdbcMappingContainer type = adjustedTimestamp.getExpressionType();
if ( type instanceof SqmExpressable ) {
adjustedTimestampType = (SqmExpressable<?>) type;
if ( type instanceof SqmExpressible) {
adjustedTimestampType = (SqmExpressible<?>) type;
}
else if (type instanceof AttributeMapping ) {
adjustedTimestampType = (SqmExpressable<?>) ( (AttributeMapping) type ).getMappedType();
adjustedTimestampType = (SqmExpressible<?>) ( (AttributeMapping) type ).getMappedType();
}
else {
// else we know it has not been transformed
@ -4883,7 +4883,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
private <X> X cleanly(Supplier<X> supplier) {
SqmByUnit byUnit = appliedByUnit;
Expression timestamp = adjustedTimestamp;
SqmExpressable<?> timestampType = adjustedTimestampType;
SqmExpressible<?> timestampType = adjustedTimestampType;
Expression scale = adjustmentScale;
boolean negate = negativeAdjustment;
adjustmentScale = null;
@ -5090,11 +5090,11 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
@Override
public CaseSimpleExpression visitSimpleCaseExpression(SqmCaseSimple<?, ?> expression) {
final List<CaseSimpleExpression.WhenFragment> whenFragments = new ArrayList<>( expression.getWhenFragments().size() );
final Supplier<MappingModelExpressable<?>> inferenceSupplier = inferrableTypeAccessStack.getCurrent();
final Supplier<MappingModelExpressible<?>> inferenceSupplier = inferrableTypeAccessStack.getCurrent();
inferrableTypeAccessStack.push(
() -> {
for ( SqmCaseSimple.WhenFragment<?, ?> whenFragment : expression.getWhenFragments() ) {
final MappingModelExpressable<?> resolved = determineCurrentExpressable( whenFragment.getCheckValue() );
final MappingModelExpressible<?> resolved = determineCurrentExpressible( whenFragment.getCheckValue() );
if ( resolved != null ) {
return resolved;
}
@ -5103,21 +5103,21 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
);
final Expression fixture = (Expression) expression.getFixture().accept( this );
final MappingModelExpressable<?> fixtureType = (MappingModelExpressable<?>) fixture.getExpressionType();
final MappingModelExpressible<?> fixtureType = (MappingModelExpressible<?>) fixture.getExpressionType();
inferrableTypeAccessStack.pop();
MappingModelExpressable<?> resolved = determineCurrentExpressable( expression );
MappingModelExpressible<?> resolved = determineCurrentExpressible( expression );
Expression otherwise = null;
for ( SqmCaseSimple.WhenFragment<?, ?> whenFragment : expression.getWhenFragments() ) {
inferrableTypeAccessStack.push( () -> fixtureType );
final Expression checkValue = (Expression) whenFragment.getCheckValue().accept( this );
inferrableTypeAccessStack.pop();
final MappingModelExpressable<?> alreadyKnown = resolved;
final MappingModelExpressible<?> alreadyKnown = resolved;
inferrableTypeAccessStack.push(
() -> alreadyKnown == null && inferenceSupplier != null ? inferenceSupplier.get() : alreadyKnown
);
final Expression resultExpression = (Expression) whenFragment.getResult().accept( this );
inferrableTypeAccessStack.pop();
resolved = (MappingModelExpressable<?>) TypeHelper.highestPrecedence( resolved, resultExpression.getExpressionType() );
resolved = (MappingModelExpressible<?>) TypeHelper.highestPrecedence( resolved, resultExpression.getExpressionType() );
whenFragments.add(
new CaseSimpleExpression.WhenFragment(
@ -5128,13 +5128,13 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
if ( expression.getOtherwise() != null ) {
final MappingModelExpressable<?> alreadyKnown = resolved;
final MappingModelExpressible<?> alreadyKnown = resolved;
inferrableTypeAccessStack.push(
() -> alreadyKnown == null && inferenceSupplier != null ? inferenceSupplier.get() : alreadyKnown
);
otherwise = (Expression) expression.getOtherwise().accept( this );
inferrableTypeAccessStack.pop();
resolved = (MappingModelExpressable<?>) TypeHelper.highestPrecedence( resolved, otherwise.getExpressionType() );
resolved = (MappingModelExpressible<?>) TypeHelper.highestPrecedence( resolved, otherwise.getExpressionType() );
}
return new CaseSimpleExpression(
@ -5148,42 +5148,42 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
@Override
public CaseSearchedExpression visitSearchedCaseExpression(SqmCaseSearched<?> expression) {
final List<CaseSearchedExpression.WhenFragment> whenFragments = new ArrayList<>( expression.getWhenFragments().size() );
final Supplier<MappingModelExpressable<?>> inferenceSupplier = inferrableTypeAccessStack.getCurrent();
MappingModelExpressable<?> resolved = determineCurrentExpressable( expression );
final Supplier<MappingModelExpressible<?>> inferenceSupplier = inferrableTypeAccessStack.getCurrent();
MappingModelExpressible<?> resolved = determineCurrentExpressible( expression );
Expression otherwise = null;
for ( SqmCaseSearched.WhenFragment<?> whenFragment : expression.getWhenFragments() ) {
inferrableTypeAccessStack.push( () -> null );
final Predicate whenPredicate = (Predicate) whenFragment.getPredicate().accept( this );
inferrableTypeAccessStack.pop();
final MappingModelExpressable<?> alreadyKnown = resolved;
final MappingModelExpressible<?> alreadyKnown = resolved;
inferrableTypeAccessStack.push(
() -> alreadyKnown == null && inferenceSupplier != null ? inferenceSupplier.get() : alreadyKnown
);
final Expression resultExpression = (Expression) whenFragment.getResult().accept( this );
inferrableTypeAccessStack.pop();
resolved = (MappingModelExpressable<?>) TypeHelper.highestPrecedence( resolved, resultExpression.getExpressionType() );
resolved = (MappingModelExpressible<?>) TypeHelper.highestPrecedence( resolved, resultExpression.getExpressionType() );
whenFragments.add( new CaseSearchedExpression.WhenFragment( whenPredicate, resultExpression ) );
}
if ( expression.getOtherwise() != null ) {
final MappingModelExpressable<?> alreadyKnown = resolved;
final MappingModelExpressible<?> alreadyKnown = resolved;
inferrableTypeAccessStack.push(
() -> alreadyKnown == null && inferenceSupplier != null ? inferenceSupplier.get() : alreadyKnown
);
otherwise = (Expression) expression.getOtherwise().accept( this );
inferrableTypeAccessStack.pop();
resolved = (MappingModelExpressable<?>) TypeHelper.highestPrecedence( resolved, otherwise.getExpressionType() );
resolved = (MappingModelExpressible<?>) TypeHelper.highestPrecedence( resolved, otherwise.getExpressionType() );
}
return new CaseSearchedExpression( resolved, whenFragments, otherwise );
}
private MappingModelExpressable<?> determineCurrentExpressable(SqmTypedNode<?> expression) {
private MappingModelExpressible<?> determineCurrentExpressible(SqmTypedNode<?> expression) {
return creationContext
.getDomainModel()
.resolveMappingExpressable( expression.getNodeType(), getFromClauseIndex()::findTableGroup );
.resolveMappingExpressible( expression.getNodeType(), getFromClauseIndex()::findTableGroup );
}
private <X> X visitWithInferredType(SqmExpression<?> expression, SqmExpression<?> inferred) {
@ -5199,9 +5199,9 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
// private <X> X visitWithLenientInferredType(SqmExpression<?> expression, SqmExpression<?> inferred) {
// inferrableTypeAccessStack.push(
// () -> {
// MappingModelExpressable<?> definedType = creationContext
// MappingModelExpressible<?> definedType = creationContext
// .getDomainModel()
// .resolveMappingExpressable(
// .resolveMappingExpressible(
// expression.getNodeType(),
// getFromClauseIndex()::findTableGroup
// );
@ -5210,7 +5210,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
// }
// definedType = creationContext
// .getDomainModel()
// .lenientlyResolveMappingExpressable(
// .lenientlyResolveMappingExpressible(
// inferred.getNodeType(),
// getFromClauseIndex()::findTableGroup
// );
@ -5230,7 +5230,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
public Object visitAny(SqmAny<?> sqmAny) {
return new Any(
visitSubQueryExpression( sqmAny.getSubquery() ),
null //resolveMappingExpressable( sqmAny.getNodeType() )
null //resolveMappingExpressible( sqmAny.getNodeType() )
);
}
@ -5238,7 +5238,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
public Object visitEvery(SqmEvery<?> sqmEvery) {
return new Every(
visitSubQueryExpression( sqmEvery.getSubquery() ),
null //resolveMappingExpressable( sqmEvery.getNodeType() )
null //resolveMappingExpressible( sqmEvery.getNodeType() )
);
}
@ -5293,7 +5293,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
return new QueryLiteral<>( jdbcValue, inferredPart );
}
final EnumJavaType<?> enumJtd = sqmEnumLiteral.getExpressableJavaType();
final EnumJavaType<?> enumJtd = sqmEnumLiteral.getExpressibleJavaType();
final JdbcType jdbcType = getTypeConfiguration().getJdbcTypeRegistry().getDescriptor( SqlTypes.TINYINT );
final BasicJavaType<Integer> relationalJtd = (BasicJavaType) getTypeConfiguration()
.getJavaTypeRegistry()
@ -5651,7 +5651,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
inferrableTypeAccessStack.push(
() -> {
for ( SqmExpression<?> listExpression : predicate.getListExpressions() ) {
final MappingModelExpressable<?> mapping = determineValueMapping( listExpression );
final MappingModelExpressible<?> mapping = determineValueMapping( listExpression );
if ( mapping != null ) {
return mapping;
}

View File

@ -9,7 +9,7 @@ package org.hibernate.query.sqm.sql;
import java.util.List;
import java.util.Map;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.sqm.tree.expression.SqmParameter;
import org.hibernate.sql.ast.spi.FromClauseAccess;
import org.hibernate.sql.ast.spi.SqlExpressionResolver;
@ -26,5 +26,5 @@ public interface SqmTranslation<T extends Statement> {
SqlExpressionResolver getSqlExpressionResolver();
FromClauseAccess getFromClauseAccess();
Map<SqmParameter<?>, List<List<JdbcParameter>>> getJdbcParamsBySqmParam();
Map<SqmParameter<?>, MappingModelExpressable<?>> getSqmParameterMappingModelTypeResolutions();
Map<SqmParameter<?>, MappingModelExpressible<?>> getSqmParameterMappingModelTypeResolutions();
}

View File

@ -9,7 +9,7 @@ package org.hibernate.query.sqm.sql;
import java.util.List;
import java.util.Map;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.sqm.tree.expression.SqmParameter;
import org.hibernate.sql.ast.spi.FromClauseAccess;
import org.hibernate.sql.ast.spi.SqlExpressionResolver;
@ -23,14 +23,14 @@ public class StandardSqmTranslation<T extends Statement> implements SqmTranslati
private final T sqlAst;
private final Map<SqmParameter<?>, List<List<JdbcParameter>>> jdbcParamMap;
private final Map<SqmParameter<?>, MappingModelExpressable<?>> parameterMappingModelTypeMap;
private final Map<SqmParameter<?>, MappingModelExpressible<?>> parameterMappingModelTypeMap;
private final SqlExpressionResolver sqlExpressionResolver;
private final FromClauseAccess fromClauseAccess;
public StandardSqmTranslation(
T sqlAst,
Map<SqmParameter<?>, List<List<JdbcParameter>>> jdbcParamMap,
Map<SqmParameter<?>, MappingModelExpressable<?>> parameterMappingModelTypeMap,
Map<SqmParameter<?>, MappingModelExpressible<?>> parameterMappingModelTypeMap,
SqlExpressionResolver sqlExpressionResolver,
FromClauseAccess fromClauseAccess) {
this.sqlAst = sqlAst;
@ -51,7 +51,7 @@ public class StandardSqmTranslation<T extends Statement> implements SqmTranslati
}
@Override
public Map<SqmParameter<?>, MappingModelExpressable<?>> getSqmParameterMappingModelTypeResolutions() {
public Map<SqmParameter<?>, MappingModelExpressible<?>> getSqmParameterMappingModelTypeResolutions() {
return parameterMappingModelTypeMap;
}

View File

@ -21,7 +21,7 @@ public interface DomainResultProducer<T> {
/*
* select p.name, p2.name from Person p, Person p2
*
* SqmPathSource (SqmExpressable) (unmapped)
* SqmPathSource (SqmExpressible) (unmapped)
*
* DomainType
* SimpleDomainType

View File

@ -127,7 +127,7 @@ public class SqlAstProcessingStateImpl
}
// @Override
// public Expression resolveSqlExpression(NonQualifiableSqlExpressable sqlSelectable) {
// public Expression resolveSqlExpression(NonQualifiableSqlExpressible sqlSelectable) {
// final Expression expression = normalize( sqlSelectable.createExpression() );
// final Consumer<Expression> expressionConsumer = resolvedExpressionConsumerAccess.get();
// if ( expressionConsumer != null ) {

View File

@ -13,12 +13,12 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.metamodel.mapping.DiscriminatedAssociationModelPart;
import org.hibernate.metamodel.mapping.EmbeddableValuedModelPart;
import org.hibernate.metamodel.mapping.EntityValuedModelPart;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.BindableType;
import org.hibernate.query.SemanticException;
import org.hibernate.query.spi.QueryParameterBinding;
import org.hibernate.query.spi.QueryParameterImplementor;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.tree.expression.SqmParameter;
import org.hibernate.sql.ast.SqlAstWalker;
import org.hibernate.sql.ast.spi.SqlSelection;
@ -36,7 +36,7 @@ import org.hibernate.sql.results.graph.basic.BasicResult;
public class SqmParameterInterpretation implements Expression, DomainResultProducer, SqlTupleContainer {
private final SqmParameter<?> sqmParameter;
private final QueryParameterImplementor<?> queryParameter;
private final MappingModelExpressable<?> valueMapping;
private final MappingModelExpressible<?> valueMapping;
private final Function<QueryParameterImplementor<?>, QueryParameterBinding<?>> queryParameterBindingResolver;
private final Expression resolvedExpression;
@ -45,7 +45,7 @@ public class SqmParameterInterpretation implements Expression, DomainResultProdu
SqmParameter<?> sqmParameter,
QueryParameterImplementor<?> queryParameter,
List<JdbcParameter> jdbcParameters,
MappingModelExpressable<?> valueMapping,
MappingModelExpressible<?> valueMapping,
Function<QueryParameterImplementor<?>, QueryParameterBinding<?>> queryParameterBindingResolver) {
this.sqmParameter = sqmParameter;
this.queryParameter = queryParameter;
@ -64,7 +64,7 @@ public class SqmParameterInterpretation implements Expression, DomainResultProdu
this.resolvedExpression = determineResolvedExpression( jdbcParameters, this.valueMapping );
}
private Expression determineResolvedExpression(List<JdbcParameter> jdbcParameters, MappingModelExpressable<?> valueMapping) {
private Expression determineResolvedExpression(List<JdbcParameter> jdbcParameters, MappingModelExpressible<?> valueMapping) {
if ( valueMapping instanceof EmbeddableValuedModelPart
|| valueMapping instanceof DiscriminatedAssociationModelPart ) {
return new SqlTuple( jdbcParameters, valueMapping );
@ -84,7 +84,7 @@ public class SqmParameterInterpretation implements Expression, DomainResultProdu
}
@Override
public MappingModelExpressable<?> getExpressionType() {
public MappingModelExpressible<?> getExpressionType() {
return valueMapping;
}
@ -105,18 +105,18 @@ public class SqmParameterInterpretation implements Expression, DomainResultProdu
.getCreationContext()
.getSessionFactory();
final SqmExpressable<?> sqmExpressable = nodeType.resolveExpressable( sessionFactory );
final SqmExpressible<?> sqmExpressible = nodeType.resolveExpressible( sessionFactory );
final SqlSelection sqlSelection = creationState.getSqlAstCreationState().getSqlExpressionResolver().resolveSqlSelection(
resolvedExpression,
sqmExpressable.getExpressableJavaType(),
sqmExpressible.getExpressibleJavaType(),
sessionFactory.getTypeConfiguration()
);
return new BasicResult<>(
sqlSelection.getValuesArrayPosition(),
resultVariable,
sqmExpressable.getExpressableJavaType()
sqmExpressible.getExpressibleJavaType()
);
}
@ -147,11 +147,11 @@ public class SqmParameterInterpretation implements Expression, DomainResultProdu
.getCreationContext()
.getSessionFactory();
final SqmExpressable<?> sqmExpressable = nodeType.resolveExpressable( sessionFactory );
final SqmExpressible<?> sqmExpressible = nodeType.resolveExpressible( sessionFactory );
return creationState.getSqlAstCreationState().getSqlExpressionResolver().resolveSqlSelection(
resolvedExpression,
sqmExpressable.getExpressableJavaType(),
sqmExpressible.getExpressibleJavaType(),
sessionFactory.getTypeConfiguration()
);
}

View File

@ -9,7 +9,7 @@ package org.hibernate.query.sqm.sql.internal;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.metamodel.mapping.MappingModelExpressable;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.query.sqm.SemanticQueryWalker;
import org.hibernate.query.sqm.internal.SqmMappingModelHelper;
import org.hibernate.sql.ast.spi.SqlAstCreationState;
@ -36,7 +36,7 @@ public class SqmTupleInterpretation<T> extends SqlTuple {
return new SqmTupleInterpretation<>(
sqmTuple,
groupedSqlExpressions,
SqmMappingModelHelper.resolveMappingModelExpressable(
SqmMappingModelHelper.resolveMappingModelExpressible(
sqmTuple,
sqlAstCreationState.getCreationContext().getDomainModel(),
sqlAstCreationState.getFromClauseAccess()::findTableGroup
@ -49,7 +49,7 @@ public class SqmTupleInterpretation<T> extends SqlTuple {
public SqmTupleInterpretation(
SqmTuple<T> sqmTuple,
List<? extends Expression> expressions,
MappingModelExpressable valueMapping) {
MappingModelExpressible valueMapping) {
super( expressions, valueMapping );
interpretedSqmTuple = sqmTuple;

View File

@ -6,22 +6,22 @@
*/
package org.hibernate.query.sqm.tree;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.type.descriptor.java.JavaType;
/**
* Accessor for {@link SqmExpressable}.
* Accessor for {@link SqmExpressible}.
*
* @author Christian Beikov
*/
public interface SqmExpressableAccessor<T> {
public interface SqmExpressibleAccessor<T> {
/**
* The Java type descriptor for this node.
*/
default JavaType<T> getNodeJavaType() {
final SqmExpressable<T> nodeType = getExpressable();
return nodeType != null ? nodeType.getExpressableJavaType() : null;
final SqmExpressible<T> nodeType = getExpressible();
return nodeType != null ? nodeType.getExpressibleJavaType() : null;
}
SqmExpressable<T> getExpressable();
SqmExpressible<T> getExpressible();
}

View File

@ -6,7 +6,7 @@
*/
package org.hibernate.query.sqm.tree;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.type.descriptor.java.JavaType;
/**
@ -15,19 +15,19 @@ import org.hibernate.type.descriptor.java.JavaType;
*
* @author Steve Ebersole
*/
public interface SqmTypedNode<T> extends SqmNode, SqmExpressableAccessor<T> {
public interface SqmTypedNode<T> extends SqmNode, SqmExpressibleAccessor<T> {
/**
* The Java type descriptor for this node.
*/
default JavaType<T> getNodeJavaType() {
final SqmExpressable<T> nodeType = getNodeType();
return nodeType != null ? nodeType.getExpressableJavaType() : null;
final SqmExpressible<T> nodeType = getNodeType();
return nodeType != null ? nodeType.getExpressibleJavaType() : null;
}
@Override
default SqmExpressable<T> getExpressable() {
default SqmExpressible<T> getExpressible() {
return getNodeType();
}
SqmExpressable<T> getNodeType();
SqmExpressible<T> getNodeType();
}

View File

@ -8,7 +8,6 @@ package org.hibernate.query.sqm.tree.cte;
import java.io.Serializable;
import org.hibernate.metamodel.mapping.ModelPart;
import org.hibernate.metamodel.mapping.ValueMapping;
/**
@ -18,15 +17,15 @@ import org.hibernate.metamodel.mapping.ValueMapping;
public class SqmCteTableColumn implements Serializable {
private final SqmCteTable cteTable;
private final String columnName;
private final ValueMapping typeExpressable;
private final ValueMapping typeExpressible;
public SqmCteTableColumn(
SqmCteTable cteTable,
String columnName,
ValueMapping typeExpressable) {
ValueMapping typeExpressible) {
this.cteTable = cteTable;
this.columnName = columnName;
this.typeExpressable = typeExpressable;
this.typeExpressible = typeExpressible;
}
public SqmCteTable getCteTable() {
@ -38,7 +37,7 @@ public class SqmCteTableColumn implements Serializable {
}
public ValueMapping getType() {
return typeExpressable;
return typeExpressible;
}
}

View File

@ -14,7 +14,7 @@ import org.hibernate.query.SemanticException;
import org.hibernate.query.hql.spi.SqmCreationState;
import org.hibernate.query.sqm.NodeBuilder;
import org.hibernate.query.sqm.SemanticQueryWalker;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.SqmPathSource;
import org.hibernate.type.descriptor.java.BasicJavaType;
import org.hibernate.type.descriptor.java.JavaType;
@ -24,7 +24,7 @@ import org.hibernate.type.descriptor.java.JavaType;
*/
public class SqmBasicValuedSimplePath<T>
extends AbstractSqmSimplePath<T>
implements BindableType<T>, SqmExpressable<T> {
implements BindableType<T>, SqmExpressible<T> {
public SqmBasicValuedSimplePath(
NavigablePath navigablePath,
SqmPathSource<T> referencedPathSource,
@ -93,7 +93,7 @@ public class SqmBasicValuedSimplePath<T>
}
@Override
public JavaType<T> getExpressableJavaType() {
public JavaType<T> getExpressibleJavaType() {
return getJavaTypeDescriptor();
}

View File

@ -14,7 +14,7 @@ import org.hibernate.query.PathException;
import org.hibernate.query.hql.spi.SqmCreationState;
import org.hibernate.query.sqm.NodeBuilder;
import org.hibernate.query.sqm.SemanticQueryWalker;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.SqmPathSource;
import org.hibernate.type.descriptor.java.JavaType;
@ -23,7 +23,7 @@ import org.hibernate.type.descriptor.java.JavaType;
*/
public class SqmEmbeddedValuedSimplePath<T>
extends AbstractSqmSimplePath<T>
implements BindableType<T>, SqmExpressable<T> {
implements BindableType<T>, SqmExpressible<T> {
public SqmEmbeddedValuedSimplePath(
NavigablePath navigablePath,
SqmPathSource<T> referencedPathSource,
@ -73,7 +73,7 @@ public class SqmEmbeddedValuedSimplePath<T>
}
@Override
public JavaType<T> getExpressableJavaType() {
public JavaType<T> getExpressibleJavaType() {
return getJavaTypeDescriptor();
}

View File

@ -15,7 +15,7 @@ import java.util.function.Consumer;
import org.hibernate.query.criteria.JpaSelection;
import org.hibernate.query.sqm.NodeBuilder;
import org.hibernate.query.sqm.SemanticQueryWalker;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.tree.select.SqmSelectableNode;
import org.hibernate.type.descriptor.java.JavaType;
@ -31,7 +31,7 @@ import jakarta.persistence.criteria.Predicate;
* @author Steve Ebersole
*/
public class SqmMapEntryReference<K,V>
implements SqmSelectableNode<Map.Entry<K,V>>, Expression<Map.Entry<K,V>>, SqmExpressable<Map.Entry<K,V>> {
implements SqmSelectableNode<Map.Entry<K,V>>, Expression<Map.Entry<K,V>>, SqmExpressible<Map.Entry<K,V>> {
@SuppressWarnings({"FieldCanBeLocal", "unused"})
private final SqmPath<?> mapPath;
private final NodeBuilder nodeBuilder;
@ -78,7 +78,7 @@ public class SqmMapEntryReference<K,V>
}
@Override
public JavaType<Map.Entry<K, V>> getExpressableJavaType() {
public JavaType<Map.Entry<K, V>> getExpressibleJavaType() {
return mapEntryTypeDescriptor;
}
@ -103,7 +103,7 @@ public class SqmMapEntryReference<K,V>
}
@Override
public SqmExpressable<Map.Entry<K, V>> getNodeType() {
public SqmExpressible<Map.Entry<K, V>> getNodeType() {
return this;
}

View File

@ -22,7 +22,7 @@ import org.hibernate.query.criteria.JpaPath;
import org.hibernate.query.hql.spi.SemanticPathPart;
import org.hibernate.query.hql.spi.SqmCreationState;
import org.hibernate.query.sqm.ParsingException;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.SqmPathSource;
import org.hibernate.query.sqm.tree.expression.SqmExpression;
import org.hibernate.query.sqm.tree.from.SqmRoot;
@ -103,13 +103,13 @@ public interface SqmPath<T> extends SqmExpression<T>, SemanticPathPart, JpaPath<
SqmPathSource<T> getNodeType();
@Override
default void applyInferableType(SqmExpressable<?> type) {
default void applyInferableType(SqmExpressible<?> type) {
// do nothing
}
@Override
default JavaType<T> getJavaTypeDescriptor() {
return getNodeType().getExpressableJavaType();
return getNodeType().getExpressibleJavaType();
}
@Override

View File

@ -145,7 +145,7 @@ public class SqmPolymorphicRootDescriptor<T> implements EntityDomainType<T> {
}
@Override
public JavaType<T> getExpressableJavaType() {
public JavaType<T> getExpressibleJavaType() {
return polymorphicJavaType;
}

Some files were not shown because too many files have changed in this diff Show More