public class SqlMappingResult extends Object
setQueryResultMapping(Class, Map, SqlQuery)
and
setQueryResultData(Object, Object[], Map, Map)
.Modifier and Type | Field and Description |
---|---|
private SqlProcessContext |
ctx
The crate for all input parameters and the context of processing.
|
(package private) Map<String,SqlMappingIdentity> |
identities
The collection of identities related to all output columns.
|
(package private) List<Integer> |
identitiesIndexes
The list of identities indexes in the list of output values.
|
(package private) org.slf4j.Logger |
logger
The internal slf4j logger.
|
(package private) Integer |
mainIdentityIndex
The main identity index in the list of output values.
|
private Map<String,SqlMappingItem> |
mappings
All sub-elements based on ANTLR grammar defined in SqlMapping.g or SqlStatement.g.
|
Constructor and Description |
---|
SqlMappingResult(SqlProcessContext ctx,
SqlMappingRule mapping,
Map<String,SqlMappingItem> outputMappings)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addMapping(SqlMappingItem item)
Adds a new mapping rule item in the merging process.
|
(package private) void |
calculateIdentities()
Calculates all identities related information.
|
List<Integer> |
getIdentitiesIndexes()
Return the list of identities indexes in the list of output values
|
Map<String,Object> |
getIds()
Construct the empty structure used for the instances of all already used identities together with the related
result instances based on identities indices.
|
Integer |
getMainIdentityIndex()
Returns the main identity index in the list of output values.
|
SqlRuntimeContext |
getRuntimeContext()
Returns the public runtime context
|
private void |
merge(SqlMappingRule mapping,
Map<String,SqlMappingItem> outputMappings)
Merge mapping rule for one META SQL query based on SqlMapping.g and SqlStatement.g.
|
void |
setQueryResultData(Object resultInstance,
Object[] resultValues,
Map<String,Object> ids,
Map<String,Class<?>> moreResultClasses)
Fills the instance of the result class with output values from the SQL query execution.
|
void |
setQueryResultMapping(Class<?> resultClass,
Map<String,Class<?>> moreResultClasses,
SqlQuery query)
Declares a scalar query results for all mapping rule items.
|
final org.slf4j.Logger logger
private SqlProcessContext ctx
private Map<String,SqlMappingItem> mappings
Map<String,SqlMappingIdentity> identities
List<Integer> identitiesIndexes
Integer mainIdentityIndex
SqlMappingResult(SqlProcessContext ctx, SqlMappingRule mapping, Map<String,SqlMappingItem> outputMappings)
ctx
- the crate for all input parameters and the context of processingmapping
- mapping rule based on SqlMapping.g or the empty oneoutputMappings
- mapping rule items based on SqlStatement.gpublic Integer getMainIdentityIndex()
public List<Integer> getIdentitiesIndexes()
public SqlRuntimeContext getRuntimeContext()
void addMapping(SqlMappingItem item)
item
- a new mapping rule itemvoid calculateIdentities()
public void setQueryResultMapping(Class<?> resultClass, Map<String,Class<?>> moreResultClasses, SqlQuery query) throws SqlRuntimeException
resultClass
- the class used for the return valuesmoreResultClasses
- more result classes used for the return values, like the collections classes or the collections itemsquery
- the SQL Engine query, an adapter or proxy to the internal JDBC or ORM staffSqlRuntimeException
- in the case of any problem with output values preparationpublic void setQueryResultData(Object resultInstance, Object[] resultValues, Map<String,Object> ids, Map<String,Class<?>> moreResultClasses) throws SqlRuntimeException
resultInstance
- the instance of the result classresultValues
- the query execution output valuesids
- the instances of all already used identities together with the related result instances based on
identities indicesmoreResultClasses
- more result classes used for the return values, like the collections classes or the collections itemsSqlRuntimeException
- in the case of any problem with output values handlingprivate void merge(SqlMappingRule mapping, Map<String,SqlMappingItem> outputMappings)
mapping
- mapping rule based on SqlMapping.g or the empty oneoutputMappings
- mapping rule items based on SqlStatement.gpublic Map<String,Object> getIds()
Copyright © 2015. All rights reserved.