| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.access.trans.QueryAssemblerHelper
org.apache.cayenne.access.trans.QualifierTranslator
public class QualifierTranslator
Translates query qualifier to SQL. Used as a helper class by query translators.
| Field Summary | |
|---|---|
| protected  boolean | matchingObject | 
| protected  DataObjectMatchTranslator | objectMatchTranslator | 
| Fields inherited from class org.apache.cayenne.access.trans.QueryAssemblerHelper | 
|---|
| out, queryAssembler, strategy | 
| Constructor Summary | |
|---|---|
| QualifierTranslator(QueryAssembler queryAssembler) | |
| Method Summary | |
|---|---|
| protected  void | appendLiteral(Object val,
              DbAttribute attr,
              Expression parentExpression)Appends SQL code to the query buffer to handle valas a parameter to
 the PreparedStatement being built. | 
| protected  void | appendObjectMatch() | 
| protected  void | detectObjectMatch(Expression exp)Called before processing an expression to initialize objectMatchTranslator if needed. | 
| protected  void | doAppendPart()Translates query qualifier to SQL WHERE clause. | 
| protected  void | doAppendPart(Expression rootNode)Translates query qualifier to SQL WHERE clause. | 
|  void | endNode(Expression node,
        Expression parentNode)Called during the traversal after an expression node children processing is finished. | 
| protected  Expression | extractQualifier() | 
|  void | finishedChild(Expression node,
              int childIndex,
              boolean hasMoreChildren)Called during traversal after a child of expression has been visited. | 
|  void | objectNode(Object leaf,
           Expression parentNode)Called during the traversal when a leaf non-expression node is encountered. | 
| protected  boolean | parenthesisNeeded(Expression node,
                  Expression parentNode) | 
| protected  void | processRelTermination(DbRelationship rel,
                      JoinType joinType,
                      String joinSplitAlias)Handles case when a DB_NAME expression ends with relationship. | 
|  void | startNode(Expression node,
          Expression parentNode)Called during the traversal before an expression node children processing is started. | 
| Methods inherited from class org.apache.cayenne.access.trans.QueryAssemblerHelper | 
|---|
| appendDbPath, appendLikeEscapeCharacter, appendLiteralDirect, appendObjPath, appendPart, getDbEntity, getObjEntity, paramsDbType, processColumn, processColumnWithQuoteSqlIdentifiers, processRelTermination | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected DataObjectMatchTranslator objectMatchTranslator
protected boolean matchingObject
| Constructor Detail | 
|---|
public QualifierTranslator(QueryAssembler queryAssembler)
| Method Detail | 
|---|
protected void doAppendPart()
                     throws IOException
doAppendPart in class QueryAssemblerHelperIOException
protected void doAppendPart(Expression rootNode)
                     throws IOException
IOExceptionprotected Expression extractQualifier()
protected void detectObjectMatch(Expression exp)
protected void appendObjectMatch()
                          throws IOException
IOException
public void finishedChild(Expression node,
                          int childIndex,
                          boolean hasMoreChildren)
TraversalHandler
finishedChild in interface TraversalHandler
public void startNode(Expression node,
                      Expression parentNode)
TraversalHandler
startNode in interface TraversalHandler
public void endNode(Expression node,
                    Expression parentNode)
TraversalHandler
endNode in interface TraversalHandler
public void objectNode(Object leaf,
                       Expression parentNode)
TraversalHandler
objectNode in interface TraversalHandler
protected boolean parenthesisNeeded(Expression node,
                                    Expression parentNode)
protected void appendLiteral(Object val,
                             DbAttribute attr,
                             Expression parentExpression)
                      throws IOException
QueryAssemblerHelperval as a parameter to
 the PreparedStatement being built. Adds val into QueryAssembler
 parameter list.
 
 If val is null, "NULL" is appended to the query.
 
 If val is a DataObject, its primary key value is used as a parameter.
 Only objects with a single column primary key can be used.
appendLiteral in class QueryAssemblerHelperval - object that should be appended as a literal to the query. Must be of one
            of "standard JDBC" types, null or a DataObject.attr - DbAttribute that has information on what type of parameter is being
            appended.
IOException
protected void processRelTermination(DbRelationship rel,
                                     JoinType joinType,
                                     String joinSplitAlias)
                              throws IOException
QueryAssemblerHelper
processRelTermination in class QueryAssemblerHelperIOException| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||