public class SqlMappingRule extends Object
merge(SqlMappingRule, SqlProcessResult)
.
Schematically:
SqlMappingRule = SqlMappingItem+ SqlMappingItem = dbName$sqlType$javaName^(value(=value2)?)*.javaName...
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
logger
The internal slf4j logger.
|
private Map<String,SqlMappingItem> |
mappings
All sub-elements based on ANTLR grammar defined in SqlMapping.g.
|
Constructor and Description |
---|
SqlMappingRule()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addMapping(SqlMappingItem item)
Adds a new Mapping item, which is a mapping rule for one column.
|
static SqlMappingRule |
getInstance(String name,
String mappingStatement,
SqlTypeFactory typeFactory)
Simple factory method (design pattern).
|
(package private) Map<String,SqlMappingItem> |
getMappings()
Returns a collection of all mapping items in this mapping rule.
|
static SqlMappingResult |
merge(SqlMappingRule mapping,
SqlProcessResult processResult)
Merge mapping rule for one META SQL query based on SqlMapping.g and SqlStatement.g.
|
protected static org.slf4j.Logger logger
private Map<String,SqlMappingItem> mappings
public SqlMappingRule()
public static SqlMappingRule getInstance(String name, String mappingStatement, SqlTypeFactory typeFactory) throws SqlEngineException
name
- the name of this mapping rulemappingStatement
- String representation of mapping ruletypeFactory
- the factory for the META types constructionSqlEngineException
- in the case of ANTRL parsing exceptionvoid addMapping(SqlMappingItem item)
item
- the mapping itemMap<String,SqlMappingItem> getMappings()
public static SqlMappingResult merge(SqlMappingRule mapping, SqlProcessResult processResult)
mapping
- the mapping rule based on SqlMapping.gprocessResult
- contains a mapping rule based on SqlStatement.gCopyright © 2014. All Rights Reserved.