Package org.hibernate.query.internal
Class ResultMementoBasicStandard
- java.lang.Object
-
- org.hibernate.query.internal.ResultMementoBasicStandard
-
- All Implemented Interfaces:
ResultMappingMementoNode,ResultMemento,ResultMementoBasic
public class ResultMementoBasicStandard extends Object implements ResultMementoBasic
Implementation ofResultMementoBasicfor scalar (basic) results.Ultimately a scalar result is defined as a column name and a
BasicTypewith the following notes:-
For JPA mappings, the column name is required. For
hbm.xmlmappings, it is optional (positional) -
Ultimately, when reading values, we need the
BasicType. We know theBasicTypein a few different ways:-
If we know an explicit
Type, that is used. -
If we do not know the
Type, but do know the Java type then we determine theBasicTypebased on the reported SQL type and its known mapping to the specified Java type -
If we know neither, we use the reported SQL type and its
recommended Java type to resolve the
BasicTypeto use
-
If we know an explicit
-
-
Field Summary
Fields Modifier and Type Field Description StringexplicitColumnName
-
Constructor Summary
Constructors Constructor Description ResultMementoBasicStandard(ColumnResult definition, ResultSetMappingResolutionContext context)Creation for JPA descriptorResultMementoBasicStandard(String explicitColumnName, BasicType<?> explicitType, ResultSetMappingResolutionContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultBuilderBasicValuedresolve(Consumer<String> querySpaceConsumer, ResultSetMappingResolutionContext context)
-
-
-
Field Detail
-
explicitColumnName
public final String explicitColumnName
-
-
Constructor Detail
-
ResultMementoBasicStandard
public ResultMementoBasicStandard(ColumnResult definition, ResultSetMappingResolutionContext context)
Creation for JPA descriptor
-
ResultMementoBasicStandard
public ResultMementoBasicStandard(String explicitColumnName, BasicType<?> explicitType, ResultSetMappingResolutionContext context)
-
-
Method Detail
-
resolve
public ResultBuilderBasicValued resolve(Consumer<String> querySpaceConsumer, ResultSetMappingResolutionContext context)
- Specified by:
resolvein interfaceResultMemento- Specified by:
resolvein interfaceResultMementoBasic
-
-