org.apache.cayenne.access.trans

## Class TrimmingQualifierTranslator

- java.lang.Object
- - org.apache.cayenne.access.trans.QueryAssemblerHelper
  - - org.apache.cayenne.access.trans.QualifierTranslator
    - - 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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `trimFunction`

    - ### Fields inherited from class org.apache.cayenne.access.trans.QualifierTranslator

      `caseInsensitive, matchingObject, objectMatchTranslator`

    - ### Fields inherited from class org.apache.cayenne.access.trans.QueryAssemblerHelper

      `out, queryAssembler, strategy`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TrimmingQualifierTranslator(QueryAssembler queryAssembler, String trimFunction)` Constructor for TrimmingQualifierTranslator.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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, operandForBitwiseAnd, operandForBitwiseNot, operandForBitwiseOr, operandForBitwiseXor, parenthesisNeeded, processRelTermination, setCaseInsensitive, 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–2017 Apache Cayenne. All rights reserved.