Class TypeAwareSQLTreeProcessor
- java.lang.Object
-
- org.apache.cayenne.access.sqlbuilder.sqltree.SimpleNodeTreeVisitor
-
- org.apache.cayenne.access.translator.select.TypeAwareSQLTreeProcessor
-
- All Implemented Interfaces:
NodeTreeVisitor
,SQLTreeProcessor
- Direct Known Subclasses:
MySQLTreeProcessor
,PostgreSQLTreeProcessor
public class TypeAwareSQLTreeProcessor extends SimpleNodeTreeVisitor implements SQLTreeProcessor
- Since:
- 4.2
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,ChildProcessor<ColumnNode>>
byColumnTypeProcessors
protected Map<NodeType,ChildProcessor<Node>>
byNodeTypeProcessors
protected Map<String,ChildProcessor<ValueNode>>
byValueTypeProcessors
protected static Class<?>
DEFAULT_TYPE
protected static String
DEFAULT_TYPE_NAME
-
Constructor Summary
Constructors Constructor Description TypeAwareSQLTreeProcessor()
-
Method Summary
-
Methods inherited from class org.apache.cayenne.access.sqlbuilder.sqltree.SimpleNodeTreeVisitor
onChildNodeEnd, onNodeEnd, onNodeStart
-
-
-
-
Field Detail
-
DEFAULT_TYPE
protected static final Class<?> DEFAULT_TYPE
-
DEFAULT_TYPE_NAME
protected static final String DEFAULT_TYPE_NAME
-
byColumnTypeProcessors
protected final Map<String,ChildProcessor<ColumnNode>> byColumnTypeProcessors
-
byValueTypeProcessors
protected final Map<String,ChildProcessor<ValueNode>> byValueTypeProcessors
-
byNodeTypeProcessors
protected final Map<NodeType,ChildProcessor<Node>> byNodeTypeProcessors
-
-
Method Detail
-
process
public Node process(Node node)
- Specified by:
process
in interfaceSQLTreeProcessor
-
registerProcessor
protected void registerProcessor(NodeType nodeType, ChildProcessor childProcessor)
-
registerColumnProcessor
protected void registerColumnProcessor(Class<?> columnType, ChildProcessor childProcessor)
-
registerValueProcessor
protected void registerValueProcessor(Class<?> columnType, ChildProcessor childProcessor)
-
onChildNodeStart
public boolean onChildNodeStart(Node parent, Node child, int index, boolean hasMore)
- Specified by:
onChildNodeStart
in interfaceNodeTreeVisitor
- Overrides:
onChildNodeStart
in classSimpleNodeTreeVisitor
- Parameters:
parent
- nodechild
- nodeindex
- of this child in parenthasMore
- true if more children after this child- Returns:
- false if visitor should stop
-
getColumnAttribute
protected DbAttribute getColumnAttribute(ColumnNode node)
-
getColumnProcessor
protected ChildProcessor<ColumnNode> getColumnProcessor(DbAttribute attr)
-
getValueAttribute
protected DbAttribute getValueAttribute(ValueNode node)
-
getValueProcessor
protected ChildProcessor<ValueNode> getValueProcessor(DbAttribute attr)
-
getObjAttributeFor
protected static Optional<ObjAttribute> getObjAttributeFor(DbAttribute dbAttribute)
-
-