|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sqlproc.engine.impl.SqlMappingRule
public class SqlMappingRule
The precompiled Mapping entity for one META SQL statement.
Instances of this class are created by the ANTLR parser. The grammar itself is defined in SqlMapping.g.
The main runtime contracts are setQueryResultData(Object, Object[])
and setQueryResultMapping(Class, SQLQuery)
.
Schematically:
SqlMappingRule = SqlMappingItem+ SqlMappingItem = dbName.sqlType.javaName.javaName...
Field Summary | |
---|---|
protected static org.slf4j.Logger |
logger
The internal slf4j logger. |
private java.util.Map<java.lang.String,SqlMappingItem> |
mappings
All sub-elements based on ANTLR grammar defined in SqlMapping.g. |
Constructor Summary | |
---|---|
SqlMappingRule()
Creates a new instance. |
|
SqlMappingRule(java.util.Map<java.lang.String,SqlMappingItem> mappings)
Creates a new instance. |
Method Summary | |
---|---|
(package private) void |
addMapping(SqlMappingItem item)
Adds a new Mapping item, which is a mapping rule for one column. |
static SqlMappingRule |
getInstance(java.lang.String mappingStatement)
Simple factory method (design pattern). |
(package private) SqlMappingRule |
merge(java.util.Map<java.lang.String,SqlMappingItem> outputMappings)
Merge mapping rule for one META SQL query based on SqlMapping.g and SqlStatement.g. |
static SqlMappingRule |
merge(SqlMappingRule mapping,
SqlProcessResult processResult)
Merge mapping rule for one META SQL query based on SqlMapping.g and SqlStatement.g. |
void |
setQueryResultData(java.lang.Object resultInstance,
java.lang.Object[] resultValues)
Fills the instance of the result class with output values from the SQL query execution. |
void |
setQueryResultMapping(java.lang.Class<?> resultClass,
org.hibernate.SQLQuery query)
Declares a scalar query result for all Mapping rule items. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.slf4j.Logger logger
private java.util.Map<java.lang.String,SqlMappingItem> mappings
Constructor Detail |
---|
public SqlMappingRule()
SqlMappingRule(java.util.Map<java.lang.String,SqlMappingItem> mappings)
mappings
- sub-elements based on ANTLR grammar defined in SqlStatement.gMethod Detail |
---|
public static SqlMappingRule getInstance(java.lang.String mappingStatement) throws SqlEngineException
mappingStatement
- String representation of Mapping rule
SqlEngineException
- in the case of ANTRL parsing exceptionvoid addMapping(SqlMappingItem item)
item
- the Mapping itempublic void setQueryResultMapping(java.lang.Class<?> resultClass, org.hibernate.SQLQuery query)
resultClass
- The class used for the return values, the SQL execution output.query
- Hibernate SQL Query instancepublic void setQueryResultData(java.lang.Object resultInstance, java.lang.Object[] resultValues)
resultInstance
- The instance of the result class.resultValues
- Query execution output valuespublic static SqlMappingRule merge(SqlMappingRule mapping, SqlProcessResult processResult)
mapping
- the mapping rule based on SqlMapping.gprocessResult
- obtains a mapping rule based on SqlStatement.g
SqlMappingRule merge(java.util.Map<java.lang.String,SqlMappingItem> outputMappings)
outputMappings
- mapping rule based on SqlStatement.g
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |