Package org.hibernate.query.internal
Class ResultMementoBasicStandard
java.lang.Object
org.hibernate.query.internal.ResultMementoBasicStandard
- All Implemented Interfaces:
ResultMappingMementoNode
,ResultMemento
,ResultMementoBasic
Implementation of
ResultMementoBasic
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 -
Constructor Summary
ConstructorsConstructorDescriptionResultMementoBasicStandard
(ColumnResult definition, ResultSetMappingResolutionContext context) Creation for JPA descriptorResultMementoBasicStandard
(String explicitColumnName, BasicType<?> explicitType, ResultSetMappingResolutionContext context) -
Method Summary
Modifier and TypeMethodDescriptionresolve
(Consumer<String> querySpaceConsumer, ResultSetMappingResolutionContext context)
-
Field Details
-
explicitColumnName
-
-
Constructor Details
-
ResultMementoBasicStandard
public ResultMementoBasicStandard(ColumnResult definition, ResultSetMappingResolutionContext context) Creation for JPA descriptor -
ResultMementoBasicStandard
public ResultMementoBasicStandard(String explicitColumnName, BasicType<?> explicitType, ResultSetMappingResolutionContext context)
-
-
Method Details
-
resolve
public ResultBuilderBasicValued resolve(Consumer<String> querySpaceConsumer, ResultSetMappingResolutionContext context) - Specified by:
resolve
in interfaceResultMemento
- Specified by:
resolve
in interfaceResultMementoBasic
-