org.apache.cayenne.access.trans
Class TrimmingQualifierTranslator

java.lang.Object
  extended by org.apache.cayenne.access.trans.QueryAssemblerHelper
      extended by org.apache.cayenne.access.trans.QualifierTranslator
          extended by org.apache.cayenne.access.trans.TrimmingQualifierTranslator
All Implemented Interfaces:
TraversalHandler
Direct Known Subclasses:
DB2QualifierTranslator, DerbyQualifierTranslator, OracleQualifierTranslator, PostgresQualifierTranslator

public class TrimmingQualifierTranslator
extends QualifierTranslator

QualifierTranslator that allows translation of qualifiers that perform comparison with CHAR columns. Some databases require trimming the values for this to work.


Field Summary
protected  String trimFunction
           
 
Fields inherited from class org.apache.cayenne.access.trans.QualifierTranslator
matchingObject, objectMatchTranslator
 
Fields inherited from class org.apache.cayenne.access.trans.QueryAssemblerHelper
out, queryAssembler, strategy
 
Constructor Summary
TrimmingQualifierTranslator(QueryAssembler queryAssembler, String trimFunction)
          Constructor for TrimmingQualifierTranslator.
 
Method Summary
 String getTrimFunction()
          Returns the trimFunction.
protected  void processColumn(DbAttribute dbAttr)
          Adds special handling of CHAR columns.
protected  void processColumnWithQuoteSqlIdentifiers(DbAttribute dbAttr, Expression pathExp)
          Adds special handling of CHAR columns.
 void setTrimFunction(String trimFunction)
          Sets the trimFunction.
 
Methods inherited from class org.apache.cayenne.access.trans.QualifierTranslator
appendLiteral, appendObjectMatch, detectObjectMatch, doAppendPart, doAppendPart, endNode, extractQualifier, finishedChild, objectNode, parenthesisNeeded, processRelTermination, startNode
 
Methods inherited from class org.apache.cayenne.access.trans.QueryAssemblerHelper
appendDbPath, appendLikeEscapeCharacter, appendLiteralDirect, appendObjPath, appendPart, getDbEntity, getObjEntity, paramsDbType, processRelTermination
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trimFunction

protected String trimFunction
Constructor Detail

TrimmingQualifierTranslator

public TrimmingQualifierTranslator(QueryAssembler queryAssembler,
                                   String trimFunction)
Constructor for TrimmingQualifierTranslator.

Method Detail

processColumn

protected void processColumn(DbAttribute dbAttr)
                      throws IOException
Adds special handling of CHAR columns.

Overrides:
processColumn in class QueryAssemblerHelper
Throws:
IOException

processColumnWithQuoteSqlIdentifiers

protected void processColumnWithQuoteSqlIdentifiers(DbAttribute dbAttr,
                                                    Expression pathExp)
                                             throws IOException
Adds special handling of CHAR columns.

Overrides:
processColumnWithQuoteSqlIdentifiers in class QueryAssemblerHelper
Throws:
IOException

getTrimFunction

public String getTrimFunction()
Returns the trimFunction.

Returns:
String

setTrimFunction

public void setTrimFunction(String trimFunction)
Sets the trimFunction.

Parameters:
trimFunction - The trimFunction to set


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.