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 ofResultMementoBasic
for scalar (basic) results.Ultimately a scalar result is defined as a column name and a
BasicType
with the following notes:-
For JPA mappings, the column name is required. For
hbm.xml
mappings, it is optional (positional) -
Ultimately, when reading values, we need the
BasicType
. We know theBasicType
in 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 theBasicType
based 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
BasicType
to use
-
If we know an explicit
-
-
Field Summary
Fields Modifier and Type Field Description String
explicitColumnName
-
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 ResultBuilderBasicValued
resolve(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:
resolve
in interfaceResultMemento
- Specified by:
resolve
in interfaceResultMementoBasic
-
-