org.apache.openjpa.jdbc.kernel.exps
Class StringLength

java.lang.Object
  extended by org.apache.openjpa.jdbc.kernel.exps.AbstractVal
      extended by org.apache.openjpa.jdbc.kernel.exps.StringFunction
          extended by org.apache.openjpa.jdbc.kernel.exps.StringLength
All Implemented Interfaces:
Serializable, Val, Value

public class StringLength
extends StringFunction

Returns the number of characters in a string.

Author:
Marc Prud'hommeaux
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.openjpa.jdbc.kernel.exps.AbstractVal
FALSE, TRUE
 
Fields inherited from interface org.apache.openjpa.jdbc.kernel.exps.Val
ABS_VAL, ARGS_VAL, CMP_EQUAL, COALESCE_VAL, CONCAT_VAL, FORCE_OUTER, GENERALCASE_VAL, INDEXOF_VAL, JOIN_REL, LENGTH_VAL, LOCATE_VAL, LOWER_VAL, MATH_VAL, NULL_CMP, NULLIF_VAL, SIMPLECASE_VAL, SQRT_VAL, SUBSTRING_VAL, TRIM_VAL, UPPER_VAL, VAL, WHENCONDITION_VAL, WHENSCALAR_VAL
 
Constructor Summary
StringLength(Val val)
          Constructor.
 
Method Summary
 void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf, int index)
          Append the indexth SQL element to the given buffer.
 int getId()
           
 Class getType()
          Return the expected type for this value, or Object if the type is unknown.
 void setImplicitType(Class type)
          Set the implicit type of the value, based on how it is used in the filter.
 
Methods inherited from class org.apache.openjpa.jdbc.kernel.exps.StringFunction
acceptVisit, calculateValue, getMetaData, getValue, groupBy, initialize, length, load, orderBy, select, selectColumns, setMetaData
 
Methods inherited from class org.apache.openjpa.jdbc.kernel.exps.AbstractVal
appendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendSize, appendType, getAlias, getName, getPath, getSelectAs, isAggregate, isVariable, isXPath, setAlias, toDataStoreValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringLength

public StringLength(Val val)
Constructor. Provide the string to operate on.

Method Detail

getType

public Class getType()
Description copied from interface: Value
Return the expected type for this value, or Object if the type is unknown.

Specified by:
getType in interface Value
Overrides:
getType in class StringFunction

setImplicitType

public void setImplicitType(Class type)
Description copied from interface: Value
Set the implicit type of the value, based on how it is used in the filter. This method is only called on values who return Object from Value.getType().

Specified by:
setImplicitType in interface Value
Overrides:
setImplicitType in class StringFunction

appendTo

public void appendTo(Select sel,
                     ExpContext ctx,
                     ExpState state,
                     SQLBuffer buf,
                     int index)
Description copied from interface: Val
Append the indexth SQL element to the given buffer.


getId

public int getId()
Specified by:
getId in interface Val
Overrides:
getId in class AbstractVal


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.