FileDocCategorySizeDatePackage
ExpressionOperator.javaAPI DocGlassfish v2 API92945Tue May 22 16:54:20 BST 2007oracle.toplink.essentials.expressions

ExpressionOperator

public class ExpressionOperator extends Object implements Serializable

Purpose: ADVANCED: The expression operator is used internally to define SQL operations and functions. It is possible for an advanced user to define their own operators.

Fields Summary
static final long
serialVersionUID
Required for serialization compatibility.
protected int
selector
protected String[]
databaseStrings
protected boolean
isPrefix
protected boolean
isRepeating
protected Class
nodeClass
protected int
type
protected int[]
argumentIndices
protected static Hashtable
allOperators
protected static Hashtable
platformOperatorNames
protected String[]
javaStrings
public static final int
LogicalOperator
Operator types
public static final int
ComparisonOperator
public static final int
AggregateOperator
public static final int
OrderOperator
public static final int
FunctionOperator
public static final int
And
Logical operators
public static final int
Or
public static final int
Not
public static final int
Equal
Comparison operators
public static final int
NotEqual
public static final int
EqualOuterJoin
public static final int
LessThan
public static final int
LessThanEqual
public static final int
GreaterThan
public static final int
GreaterThanEqual
public static final int
Like
public static final int
NotLike
public static final int
In
public static final int
InSubQuery
public static final int
NotIn
public static final int
NotInSubQuery
public static final int
Between
public static final int
NotBetween
public static final int
IsNull
public static final int
NotNull
public static final int
Exists
public static final int
NotExists
public static final int
LikeEscape
public static final int
Decode
public static final int
Case
public static final int
Count
Aggregate operators
public static final int
Sum
public static final int
Average
public static final int
Maximum
public static final int
Minimum
public static final int
StandardDeviation
public static final int
Variance
public static final int
Distinct
public static final int
Ascending
Ordering operators
public static final int
Descending
public static final int
ToUpperCase
Function operators
public static final int
ToLowerCase
public static final int
Chr
public static final int
Concat
public static final int
HexToRaw
public static final int
Initcap
public static final int
Instring
public static final int
Soundex
public static final int
LeftPad
public static final int
LeftTrim
public static final int
Replace
public static final int
RightPad
public static final int
RightTrim
public static final int
Substring
public static final int
ToNumber
public static final int
Translate
public static final int
Trim
public static final int
Ascii
public static final int
Length
public static final int
CharIndex
public static final int
CharLength
public static final int
Difference
public static final int
Reverse
public static final int
Replicate
public static final int
Right
public static final int
Locate
public static final int
Locate2
public static final int
ToChar
public static final int
ToCharWithFormat
public static final int
RightTrim2
public static final int
Any
public static final int
Some
public static final int
All
public static final int
Trim2
public static final int
LeftTrim2
public static final int
AddMonths
public static final int
DateToString
public static final int
LastDay
public static final int
MonthsBetween
public static final int
NextDay
public static final int
RoundDate
public static final int
ToDate
public static final int
Today
public static final int
AddDate
public static final int
DateName
public static final int
DatePart
public static final int
DateDifference
public static final int
TruncateDate
public static final int
NewTime
public static final int
Nvl
public static final int
CurrentDate
public static final int
CurrentTime
public static final int
Ceil
public static final int
Cos
public static final int
Cosh
public static final int
Abs
public static final int
Acos
public static final int
Asin
public static final int
Atan
public static final int
Exp
public static final int
Sqrt
public static final int
Floor
public static final int
Ln
public static final int
Log
public static final int
Mod
public static final int
Power
public static final int
Round
public static final int
Sign
public static final int
Sin
public static final int
Sinh
public static final int
Tan
public static final int
Tanh
public static final int
Trunc
public static final int
Greatest
public static final int
Least
public static final int
Add
public static final int
Subtract
public static final int
Divide
public static final int
Multiply
public static final int
Atan2
public static final int
Cot
public static final int
Deref
public static final int
Ref
public static final int
RefToHex
public static final int
Value
public static final int
Extract
public static final int
ExtractValue
public static final int
ExistsNode
public static final int
GetStringVal
public static final int
GetNumberVal
public static final int
IsFragment
Constructors Summary
public ExpressionOperator()
ADVANCED: Create a new operator.


              
      
        this.type = FunctionOperator;
        // For bug 2780072 provide default behavior to make this class more useable.
        setNodeClass(ClassConstants.FunctionExpression_Class);
    
public ExpressionOperator(int selector, Vector newDatabaseStrings)
ADVANCED: Create a new operator with the given name(s) and strings to print.

        this.type = FunctionOperator;
        // For bug 2780072 provide default behavior to make this class more useable.
        setNodeClass(ClassConstants.FunctionExpression_Class);
        this.selector = selector;
        this.printsAs(newDatabaseStrings);
    
Methods Summary
public static oracle.toplink.essentials.expressions.ExpressionOperatorabs()
INTERNAL: Build operator.

        return simpleFunction(Abs, "ABS");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatoracos()
INTERNAL: Build operator.

        return simpleFunction(Acos, "ACOS");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatoraddDate()
INTERNAL: Build operator.

        ExpressionOperator exOperator = simpleThreeArgumentFunction(AddDate, "DATEADD");
        int[] indices = new int[3];
        indices[0] = 1;
        indices[1] = 2;
        indices[2] = 0;

        exOperator.setArgumentIndices(indices);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatoraddMonths()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(AddMonths, "ADD_MONTHS");
    
public static voidaddOperator(oracle.toplink.essentials.expressions.ExpressionOperator exOperator)
ADVANCED: Add an operator to the global list of operators.

        allOperators.put(new Integer(exOperator.getSelector()), exOperator);
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorall()
INTERNAL: Create the ALL operator.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(All);
        exOperator.printsAs("ALL");
        exOperator.bePostfix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorand()
INTERNAL: Create the AND operator.

        return simpleLogical(And, "AND", "and");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorany()
INTERNAL: Create the ANY operator.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(Any);
        exOperator.printsAs("ANY");
        exOperator.bePostfix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public java.lang.ObjectapplyFunction(java.lang.Object source, java.util.Vector arguments)
INTERNAL: Apply this to an object in memory. Throw an error if the function is not supported.

        if (source instanceof String) {
            if (getSelector() == ToUpperCase) {
                return ((String)source).toUpperCase();
            } else if (getSelector() == ToLowerCase) {
                return ((String)source).toLowerCase();
            } else if ((getSelector() == Concat) && (arguments.size() == 1) && (arguments.elementAt(0) instanceof String)) {
                return ((String)source).concat((String)arguments.elementAt(0));
            } else if ((getSelector() == Substring) && (arguments.size() == 2) && (arguments.elementAt(0) instanceof Number) && (arguments.elementAt(1) instanceof Number)) {
                // assume the first parameter to be 1-based first index of the substring, the second - substring length.
                int beginIndexInclusive = ((Number)arguments.elementAt(0)).intValue() - 1;
                int endIndexExclusive = beginIndexInclusive +  ((Number)arguments.elementAt(1)).intValue();
                return ((String)source).substring(beginIndexInclusive, endIndexExclusive);
            } else if (getSelector() == ToNumber) {
                return new java.math.BigDecimal((String)source);
            } else if (getSelector() == Trim) {
                return ((String)source).trim();
            } else if (getSelector() == Length) {
                return new Integer(((String)source).length());
            }
        } else if (source instanceof Number) {
            if (getSelector() == Ceil) {
                return new Double(Math.ceil(((Number)source).doubleValue()));
            } else if (getSelector() == Cos) {
                return new Double(Math.cos(((Number)source).doubleValue()));
            } else if (getSelector() == Abs) {
                return new Double(Math.abs(((Number)source).doubleValue()));
            } else if (getSelector() == Acos) {
                return new Double(Math.acos(((Number)source).doubleValue()));
            } else if (getSelector() == Asin) {
                return new Double(Math.asin(((Number)source).doubleValue()));
            } else if (getSelector() == Atan) {
                return new Double(Math.atan(((Number)source).doubleValue()));
            } else if (getSelector() == Exp) {
                return new Double(Math.exp(((Number)source).doubleValue()));
            } else if (getSelector() == Sqrt) {
                return new Double(Math.sqrt(((Number)source).doubleValue()));
            } else if (getSelector() == Floor) {
                return new Double(Math.floor(((Number)source).doubleValue()));
            } else if (getSelector() == Log) {
                return new Double(Math.log(((Number)source).doubleValue()));
            } else if ((getSelector() == Power) && (arguments.size() == 1) && (arguments.elementAt(0) instanceof Number)) {
                return new Double(Math.pow(((Number)source).doubleValue(), (((Number)arguments.elementAt(0)).doubleValue())));
            } else if (getSelector() == Round) {
                return new Double(Math.round(((Number)source).doubleValue()));
            } else if (getSelector() == Sin) {
                return new Double(Math.sin(((Number)source).doubleValue()));
            } else if (getSelector() == Tan) {
                return new Double(Math.tan(((Number)source).doubleValue()));
            } else if ((getSelector() == Greatest) && (arguments.size() == 1) && (arguments.elementAt(0) instanceof Number)) {
                return new Double(Math.max(((Number)source).doubleValue(), (((Number)arguments.elementAt(0)).doubleValue())));
            } else if ((getSelector() == Least) && (arguments.size() == 1) && (arguments.elementAt(0) instanceof Number)) {
                return new Double(Math.min(((Number)source).doubleValue(), (((Number)arguments.elementAt(0)).doubleValue())));
            } else if ((getSelector() == Add) && (arguments.size() == 1) && (arguments.elementAt(0) instanceof Number)) {
                return new Double(((Number)source).doubleValue() + (((Number)arguments.elementAt(0)).doubleValue()));
            } else if ((getSelector() == Subtract) && (arguments.size() == 1) && (arguments.elementAt(0) instanceof Number)) {
                return new Double(((Number)source).doubleValue() - (((Number)arguments.elementAt(0)).doubleValue()));
            } else if ((getSelector() == Divide) && (arguments.size() == 1) && (arguments.elementAt(0) instanceof Number)) {
                return new Double(((Number)source).doubleValue() / (((Number)arguments.elementAt(0)).doubleValue()));
            } else if ((getSelector() == Multiply) && (arguments.size() == 1) && (arguments.elementAt(0) instanceof Number)) {
                return new Double(((Number)source).doubleValue() * (((Number)arguments.elementAt(0)).doubleValue()));
            }
        }

        throw QueryException.cannotConformExpression();
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorascending()
INTERNAL: Create the ASCENDING operator.

        return simpleOrdering(Ascending, "ASC", "ascending");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorascii()
INTERNAL: Build operator.

        return simpleFunction(Ascii, "ASCII");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorasin()
INTERNAL: Build operator.

        return simpleFunction(Asin, "ASIN");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatoratan()
INTERNAL: Build operator.

        return simpleFunction(Atan, "ATAN");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatoraverage()
INTERNAL: Create the AVERAGE operator.

        return simpleAggregate(Average, "AVG", "average");
    
public voidbePostfix()
ADVANCED: Tell the operator to be postfix, i.e. its strings start printing after those of its first argument.

        isPrefix = false;
    
public voidbePrefix()
ADVANCED: Tell the operator to be pretfix, i.e. its strings start printing before those of its first argument.

        isPrefix = true;
    
public voidbeRepeating()
INTERNAL: Make this a repeating argument. Currently unused.

        isRepeating = true;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorbetween()
INTERNAL: Create the BETWEEN Operator

        ExpressionOperator result = new ExpressionOperator();
        result.setSelector(Between);
        result.setType(ComparisonOperator);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement("(");
        v.addElement(" BETWEEN ");
        v.addElement(" AND ");
        v.addElement(")");
        result.printsAs(v);
        result.bePrefix();
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorcaseStatement()
INTERNAL: Build operator. Note: This operator works differently from other operators.

see
Expression#caseStatement(Hashtable, String)

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(Case);
        exOperator.bePrefix();
        exOperator.setNodeClass(FunctionExpression.class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorceil()
INTERNAL: Build operator.

        return simpleFunction(Ceil, "CEIL");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorcharIndex()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(CharIndex, "CHARINDEX");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorcharLength()
INTERNAL: Build operator.

        return simpleFunction(CharLength, "CHAR_LENGTH");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorchr()
INTERNAL: Build operator.

        return simpleFunction(Chr, "CHR");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorconcat()
INTERNAL: Build operator.

        return simpleMath(Concat, "+");
    
public booleanconformBetween(java.lang.Object left, java.lang.Object right)
INTERNAL: Compare bewteen in memory.

        Object start = ((Vector)right).elementAt(0);
        Object end = ((Vector)right).elementAt(1);
        if ((left == null) || (start == null) || (end == null)) {
            return false;
        }
        if ((left instanceof Number) && (start instanceof Number) && (end instanceof Number)) {
            return ((((Number)left).doubleValue()) >= (((Number)start).doubleValue())) && ((((Number)left).doubleValue()) <= (((Number)end).doubleValue()));
        } else if ((left instanceof String) && (start instanceof String) && (end instanceof String)) {
            return ((((String)left).compareTo(((String)start)) > 0) || (((String)left).compareTo(((String)start)) == 0)) && ((((String)left).compareTo(((String)end)) < 0) || (((String)left).compareTo(((String)end)) == 0));
        } else if ((left instanceof java.util.Date) && (start instanceof java.util.Date) && (end instanceof java.util.Date)) {
            return (((java.util.Date)left).after(((java.util.Date)start)) || ((java.util.Date)left).equals(((java.util.Date)start))) && (((java.util.Date)left).before(((java.util.Date)end)) || ((java.util.Date)left).equals(((java.util.Date)end)));
        }

        throw QueryException.cannotConformExpression();
    
public booleanconformLike(java.lang.Object left, java.lang.Object right)
INTERNAL: Compare like in memory. This only works for % not _.

author
Christian Weeks aka ChristianLink

        if ((right == null) && (left == null)) {
            return true;
        }
        if (!(right instanceof String) || !(left instanceof String)) {
            throw QueryException.cannotConformExpression();
        }
        String likeString = (String)right;
        if (likeString.indexOf("_") != -1) {
            throw QueryException.cannotConformExpression();
        }
        String value = (String)left;
        if (likeString.indexOf("%") == -1) {
            // No % symbols
            return left.equals(right);
        }
        boolean strictStart = !likeString.startsWith("%");
        boolean strictEnd = !likeString.endsWith("%");
        StringTokenizer tokens = new StringTokenizer(likeString, "%");
        int lastPosition = 0;
        String lastToken = null;
        if (strictStart) {
            lastToken = tokens.nextToken();
            if (!value.startsWith(lastToken)) {
                return false;
            }
        }
        while (tokens.hasMoreTokens()) {
            lastToken = tokens.nextToken();
            lastPosition = value.indexOf(lastToken, lastPosition);
            if (lastPosition < 0) {
                return false;
            }
        }
        if (strictEnd) {
            return value.endsWith(lastToken);
        }
        return true;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorcos()
INTERNAL: Build operator.

        return simpleFunction(Cos, "COS");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorcosh()
INTERNAL: Build operator.

        return simpleFunction(Cosh, "COSH");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorcot()
INTERNAL: Build operator.

        return simpleFunction(Cot, "COT");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorcount()
INTERNAL: Create the COUNT operator.

        return simpleAggregate(Count, "COUNT", "count");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorcurrentDate()
INTERNAL: Build operator.

        return simpleFunctionNoParentheses(CurrentDate,  "CURRENT_DATE");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorcurrentTime()
INTERNAL: Build operator.

        return simpleFunctionNoParentheses(CurrentTime, "CURRENT_TIME");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorcurrentTimeStamp()
INTERNAL: Build operator.

        return simpleFunctionNoParentheses(Today,  "CURRENT_TIMESTAMP");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatordateDifference()
INTERNAL: Build operator.

        return simpleThreeArgumentFunction(DateDifference, "DATEDIFF");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatordateName()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(DateName, "DATENAME");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatordatePart()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(DatePart, "DATEPART");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatordateToString()
INTERNAL: Build operator.

        return simpleFunction(DateToString, "TO_CHAR");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatordecode()
INTERNAL: Build operator. Note: This operator works differently from other operators.

see
Expression#decode(Hashtable, String)

        ExpressionOperator exOperator = new ExpressionOperator();

        exOperator.setSelector(Decode);

        exOperator.setNodeClass(FunctionExpression.class);
        exOperator.setType(FunctionOperator);
        exOperator.bePrefix();
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorderef()
INTERNAL: Build operator.

        return simpleFunction(Deref, "DEREF");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatordescending()
INTERNAL: Create the DESCENDING operator.

        return simpleOrdering(Descending, "DESC", "descending");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatordifference()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Difference, "DIFFERENCE");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatordistinct()
INTERNAL: Create the DISTINCT operator.

        return simpleFunction(Distinct, "DISTINCT", "distinct");
    
public booleandoesRelationConform(java.lang.Object left, java.lang.Object right)
INTERNAL: Compare the values in memory. Used for in-memory querying, all operators are not support.

        // Big case statement follows.
        // Note, compareTo for String returns a number <= -1 if the String is less than.  We assumed that
        // it would return -1.  The same thing for strings that are greater than (ie it returns >= 1). PWK
        // Equals
        if (getSelector() == Equal) {
            if ((left == null) && (right == null)) {
                return true;
            } else if ((left == null) || (right == null)) {
                return false;
            }
            if (((left instanceof Number) && (right instanceof Number)) && (left.getClass() != right.getClass())) {
                return ((Number)left).doubleValue() == ((Number)right).doubleValue();
            }
            return left.equals(right);
        } else if (getSelector() == NotEqual) {
            if ((left == null) && (right == null)) {
                return false;
            } else if ((left == null) || (right == null)) {
                return true;
            }
            return !left.equals(right);
        } else if (getSelector() == IsNull) {
            return (left == null);
        }
        if (getSelector() == NotNull) {
            return (left != null);
        }
        // Less thans, greater thans
        else if (getSelector() == LessThan) {// You have gottan love polymorphism in Java, NOT!!!
            if ((left == null) || (right == null)) {
                return false;
            }
            if ((left instanceof Number) && (right instanceof Number)) {
                return (((Number)left).doubleValue()) < (((Number)right).doubleValue());
            } else if ((left instanceof String) && (right instanceof String)) {
                return ((String)left).compareTo(((String)right)) < 0;
            } else if ((left instanceof java.util.Date) && (right instanceof java.util.Date)) {
                return ((java.util.Date)left).before(((java.util.Date)right));
            }
        } else if (getSelector() == LessThanEqual) {
            if ((left == null) && (right == null)) {
                return true;
            } else if ((left == null) || (right == null)) {
                return false;
            }
            if ((left instanceof Number) && (right instanceof Number)) {
                return (((Number)left).doubleValue()) <= (((Number)right).doubleValue());
            } else if ((left instanceof String) && (right instanceof String)) {
                int compareValue = ((String)left).compareTo(((String)right));
                return (compareValue < 0) || (compareValue == 0);
            } else if ((left instanceof java.util.Date) && (right instanceof java.util.Date)) {
                return ((java.util.Date)left).equals(((java.util.Date)right)) || ((java.util.Date)left).before(((java.util.Date)right));
            }
        } else if (getSelector() == GreaterThan) {
            if ((left == null) || (right == null)) {
                return false;
            }
            if ((left instanceof Number) && (right instanceof Number)) {
                return (((Number)left).doubleValue()) > (((Number)right).doubleValue());
            } else if ((left instanceof String) && (right instanceof String)) {
                int compareValue = ((String)left).compareTo(((String)right));
                return (compareValue > 0);
            } else if ((left instanceof java.util.Date) && (right instanceof java.util.Date)) {
                return ((java.util.Date)left).after(((java.util.Date)right));
            }
        } else if (getSelector() == GreaterThanEqual) {
            if ((left == null) && (right == null)) {
                return true;
            } else if ((left == null) || (right == null)) {
                return false;
            }
            if ((left instanceof Number) && (right instanceof Number)) {
                return (((Number)left).doubleValue()) >= (((Number)right).doubleValue());
            } else if ((left instanceof String) && (right instanceof String)) {
                int compareValue = ((String)left).compareTo(((String)right));
                return (compareValue > 0) || (compareValue == 0);
            } else if ((left instanceof java.util.Date) && (right instanceof java.util.Date)) {
                return ((java.util.Date)left).equals(((java.util.Date)right)) || ((java.util.Date)left).after(((java.util.Date)right));
            }
        }
        // Between
        else if ((getSelector() == Between) && (right instanceof Vector) && (((Vector)right).size() == 2)) {
            return conformBetween(left, right);
        } else if ((getSelector() == NotBetween) && (right instanceof Vector) && (((Vector)right).size() == 2)) {
            return !conformBetween(left, right);
        }
        // In
        else if ((getSelector() == In) && (right instanceof Vector)) {
            return ((Vector)right).contains(left);
        } else if ((getSelector() == NotIn) && (right instanceof Vector)) {
            return !((Vector)right).contains(left);
        }
        // Like
        //conformLike(left, right);
        else if ((getSelector() == Like) || (getSelector() == NotLike)) {
            // the regular expression framework we use to conform like is only supported in
            // JDK 1.4 and later.  We will ask our JavaPlatform to do this for us.
            int doesLikeConform = JavaPlatform.conformLike(left, right);
            if (doesLikeConform == JavaPlatform.TRUE) {
                return getSelector() == Like;// Negate for NotLike
            } else if (doesLikeConform == JavaPlatform.FALSE) {
                return getSelector() != Like;// Negate for NotLike
            }
        }

        throw QueryException.cannotConformExpression();
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorequalOuterJoin()
INTERNAL: Initialize the outer join operator Note: This is merely a shell which is incomplete, and so will be replaced by the platform's operator when we go to print. We need to create this here so that the expression class is correct, normally it assumes functions for unknown operators.

        return simpleRelation(EqualOuterJoin, "=*");
    
public booleanequals(java.lang.Object object)
PUBLIC: Test for equality

        if (!(object instanceof ExpressionOperator)) {
            return false;
        }
        return getSelector() == ((ExpressionOperator)object).getSelector();
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorexists()
INTERNAL: Create the EXISTS operator.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(Exists);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        v.addElement("EXISTS" + " ");
        v.addElement(" ");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorexistsNode()
INTERNAL: Create the existsNode expression operator

        ExpressionOperator result = new ExpressionOperator();
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement("existsNode(");
        v.addElement(",");
        v.addElement(")");
        result.printsAs(v);
        result.bePrefix();
        result.setSelector(ExistsNode);
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorexp()
INTERNAL: Build operator.

        return simpleFunction(Exp, "EXP");
    
public oracle.toplink.essentials.expressions.ExpressionexpressionFor(oracle.toplink.essentials.expressions.Expression base)
INTERNAL: Create an expression for this operator, using the given base.

        return expressionForArguments(base, oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(0));
    
public oracle.toplink.essentials.expressions.ExpressionexpressionFor(oracle.toplink.essentials.expressions.Expression base, java.lang.Object value)
INTERNAL: Create an expression for this operator, using the given base and a single argument.

        return newExpressionForArgument(base, value);
    
public oracle.toplink.essentials.expressions.ExpressionexpressionForArguments(oracle.toplink.essentials.expressions.Expression base, java.util.Vector arguments)
INTERNAL: Create an expression for this operator, using the given base and arguments.

        return newExpressionForArguments(base, arguments);
    
public oracle.toplink.essentials.expressions.ExpressionexpressionForWithBaseLast(oracle.toplink.essentials.expressions.Expression base, java.lang.Object value)
INTERNAL: Create an expression for this operator, using the given base and a single argument. Base is used last in the expression

        return newExpressionForArgumentWithBaseLast(base, value);
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorextract()
INTERNAL: Create the extract expression operator

        ExpressionOperator result = new ExpressionOperator();
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement("extract(");
        v.addElement(",");
        v.addElement(")");
        result.printsAs(v);
        result.bePrefix();
        result.setSelector(Extract);
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorextractValue()
INTERNAL: Create the extractValue expression operator

        ExpressionOperator result = new ExpressionOperator();
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement("extractValue(");
        v.addElement(",");
        v.addElement(")");
        result.printsAs(v);
        result.bePrefix();
        result.setSelector(ExtractValue);
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorfloor()
INTERNAL: Build operator.

        return simpleFunction(Floor, "FLOOR");
    
public static synchronized java.util.HashtablegetAllOperators()
ADVANCED: Return the hashtable of all operators.

        if (allOperators == null) {
            initializeOperators();
        }
        return allOperators;
    
public java.lang.String[]getDatabaseStrings()
INTERNAL:

        return databaseStrings;
    
public java.lang.String[]getJavaStrings()
INTERNAL:

        return javaStrings;
    
public java.lang.ClassgetNodeClass()
INTERNAL:

        return nodeClass;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorgetNumberVal()

        ExpressionOperator result = new ExpressionOperator();
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement(".getNumberVal()");
        result.printsAs(v);
        result.bePostfix();
        result.setSelector(GetNumberVal);
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorgetOperator(java.lang.Integer selector)
INTERNAL: Lookup the operator with the given name.

        return (ExpressionOperator)getAllOperators().get(selector);
    
public static java.lang.StringgetPlatformOperatorName(int operator)
INTERNAL: Initialize a mapping to the platform operator names for usage with exceptions.

        String name = (String)getPlatformOperatorNames().get(new Integer(operator));
        if (name == null) {
            name = String.valueOf(operator);
        }
        return name;
    
public static synchronized java.util.HashtablegetPlatformOperatorNames()
INTERNAL: Initialize a mapping to the platform operator names for usage with exceptions.

        if (platformOperatorNames == null) {
            platformOperatorNames = new Hashtable();
            platformOperatorNames.put(new Integer(ToUpperCase), "ToUpperCase");
            platformOperatorNames.put(new Integer(ToLowerCase), "ToLowerCase");
            platformOperatorNames.put(new Integer(Chr), "Chr");
            platformOperatorNames.put(new Integer(Concat), "Concat");
            platformOperatorNames.put(new Integer(HexToRaw), "HexToRaw");
            platformOperatorNames.put(new Integer(Initcap), "Initcap");
            platformOperatorNames.put(new Integer(Instring), "Instring");
            platformOperatorNames.put(new Integer(Soundex), "Soundex");
            platformOperatorNames.put(new Integer(LeftPad), "LeftPad");
            platformOperatorNames.put(new Integer(LeftTrim), "LeftTrim");
            platformOperatorNames.put(new Integer(RightPad), "RightPad");
            platformOperatorNames.put(new Integer(RightTrim), "RightTrim");
            platformOperatorNames.put(new Integer(Substring), "Substring");
            platformOperatorNames.put(new Integer(Translate), "Translate");
            platformOperatorNames.put(new Integer(Ascii), "Ascii");
            platformOperatorNames.put(new Integer(Length), "Length");
            platformOperatorNames.put(new Integer(CharIndex), "CharIndex");
            platformOperatorNames.put(new Integer(CharLength), "CharLength");
            platformOperatorNames.put(new Integer(Difference), "Difference");
            platformOperatorNames.put(new Integer(Reverse), "Reverse");
            platformOperatorNames.put(new Integer(Replicate), "Replicate");
            platformOperatorNames.put(new Integer(Right), "Right");
            platformOperatorNames.put(new Integer(Locate), "Locate");
            platformOperatorNames.put(new Integer(Locate2), "Locate");
            platformOperatorNames.put(new Integer(ToNumber), "ToNumber");
            platformOperatorNames.put(new Integer(ToChar), "ToChar");
            platformOperatorNames.put(new Integer(ToCharWithFormat), "ToChar");
            platformOperatorNames.put(new Integer(AddMonths), "AddMonths");
            platformOperatorNames.put(new Integer(DateToString), "DateToString");
            platformOperatorNames.put(new Integer(MonthsBetween), "MonthsBetween");
            platformOperatorNames.put(new Integer(NextDay), "NextDay");
            platformOperatorNames.put(new Integer(RoundDate), "RoundDate");
            platformOperatorNames.put(new Integer(AddDate), "AddDate");
            platformOperatorNames.put(new Integer(DateName), "DateName");
            platformOperatorNames.put(new Integer(DatePart), "DatePart");
            platformOperatorNames.put(new Integer(DateDifference), "DateDifference");
            platformOperatorNames.put(new Integer(TruncateDate), "TruncateDate");
            platformOperatorNames.put(new Integer(NewTime), "NewTime");
            platformOperatorNames.put(new Integer(Nvl), "Nvl");
            platformOperatorNames.put(new Integer(NewTime), "NewTime");
            platformOperatorNames.put(new Integer(Ceil), "Ceil");
            platformOperatorNames.put(new Integer(Cos), "Cos");
            platformOperatorNames.put(new Integer(Cosh), "Cosh");
            platformOperatorNames.put(new Integer(Abs), "Abs");
            platformOperatorNames.put(new Integer(Acos), "Acos");
            platformOperatorNames.put(new Integer(Asin), "Asin");
            platformOperatorNames.put(new Integer(Atan), "Atan");
            platformOperatorNames.put(new Integer(Exp), "Exp");
            platformOperatorNames.put(new Integer(Sqrt), "Sqrt");
            platformOperatorNames.put(new Integer(Floor), "Floor");
            platformOperatorNames.put(new Integer(Ln), "Ln");
            platformOperatorNames.put(new Integer(Log), "Log");
            platformOperatorNames.put(new Integer(Mod), "Mod");
            platformOperatorNames.put(new Integer(Power), "Power");
            platformOperatorNames.put(new Integer(Round), "Round");
            platformOperatorNames.put(new Integer(Sign), "Sign");
            platformOperatorNames.put(new Integer(Sin), "Sin");
            platformOperatorNames.put(new Integer(Sinh), "Sinh");
            platformOperatorNames.put(new Integer(Tan), "Tan");
            platformOperatorNames.put(new Integer(Tanh), "Tanh");
            platformOperatorNames.put(new Integer(Trunc), "Trunc");
            platformOperatorNames.put(new Integer(Greatest), "Greatest");
            platformOperatorNames.put(new Integer(Least), "Least");
            platformOperatorNames.put(new Integer(Add), "Add");
            platformOperatorNames.put(new Integer(Subtract), "Subtract");
            platformOperatorNames.put(new Integer(Divide), "Divide");
            platformOperatorNames.put(new Integer(Multiply), "Multiply");
            platformOperatorNames.put(new Integer(Atan2), "Atan2");
            platformOperatorNames.put(new Integer(Cot), "Cot");
            platformOperatorNames.put(new Integer(Deref), "Deref");
            platformOperatorNames.put(new Integer(Ref), "Ref");
            platformOperatorNames.put(new Integer(RefToHex), "RefToHex");
            platformOperatorNames.put(new Integer(Value), "Value");
            platformOperatorNames.put(new Integer(Extract), "Extract");
            platformOperatorNames.put(new Integer(ExtractValue), "ExtractValue");
            platformOperatorNames.put(new Integer(ExistsNode), "ExistsNode");
            platformOperatorNames.put(new Integer(GetStringVal), "GetStringVal");
            platformOperatorNames.put(new Integer(GetNumberVal), "GetNumberVal");
            platformOperatorNames.put(new Integer(IsFragment), "IsFragment");
        }
        return platformOperatorNames;
    
public intgetSelector()
INTERNAL: Return the selector id.

        return selector;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorgetStringVal()

        ExpressionOperator result = new ExpressionOperator();
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement(".getStringVal()");
        result.printsAs(v);
        result.bePostfix();
        result.setSelector(GetStringVal);
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public intgetType()
ADVANCED: Return the type of function. This must be one of the static function types defined in this class.

        return this.type;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorgreatest()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Greatest, "GREATEST");
    
public inthashCode()
PUBLIC: Return the hash-code based on the unique selector.

        return getSelector();
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorhexToRaw()
INTERNAL: Build operator.

        return simpleFunction(HexToRaw, "HEXTORAW");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorifNull()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Nvl, "NVL");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorin()
INTERNAL: Create the IN operator.

        ExpressionOperator result = new ExpressionOperator();
        result.setType(ExpressionOperator.FunctionOperator);
        result.setSelector(In);
        Vector v = new Vector(2);
        v.addElement(" IN (");
        v.addElement(")");
        result.printsAs(v);
        result.bePostfix();
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorinSubQuery()
INTERNAL: Create the IN operator taking a subquery. Note, the subquery itself comes with parenethesis, so the IN operator should not add any parenethesis.

        ExpressionOperator result = new ExpressionOperator();
        result.setType(ExpressionOperator.FunctionOperator);
        result.setSelector(InSubQuery);
        Vector v = new Vector(1);
        v.addElement(" IN ");
        result.printsAs(v);
        result.bePostfix();
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorinitcap()
INTERNAL: Build operator.

        return simpleFunction(Initcap, "INITCAP");
    
protected static voidinitializeAggregateFunctionOperators()
INTERNAL:

        addOperator(count());
        addOperator(sum());
        addOperator(average());
        addOperator(minimum());
        addOperator(maximum());
        addOperator(variance());
        addOperator(standardDeviation());
        addOperator(distinct());
    
protected static voidinitializeFunctionOperators()
INTERNAL:

        addOperator(notOperator());
        addOperator(ascending());
        addOperator(descending());
        addOperator(any());
        addOperator(some());
        addOperator(all());
        addOperator(in());
        addOperator(inSubQuery());
        addOperator(notIn());
        addOperator(notInSubQuery());
    
protected static voidinitializeLogicalOperators()
INTERNAL:

        addOperator(and());
        addOperator(or());
        addOperator(isNull());
        addOperator(notNull());

    
public static java.util.HashtableinitializeOperators()
INTERNAL:

        resetOperators();
        initializeFunctionOperators();
        initializeRelationOperators();
        initializeLogicalOperators();
        initializeAggregateFunctionOperators();
        return allOperators;
    
protected static voidinitializeRelationOperators()
INTERNAL:

        addOperator(simpleRelation(Equal, "=", "equal"));
        addOperator(simpleRelation(NotEqual, "<>", "notEqual"));
        addOperator(simpleRelation(LessThan, "<", "lessThan"));
        addOperator(simpleRelation(LessThanEqual, "<=", "lessThanEqual"));
        addOperator(simpleRelation(GreaterThan, ">", "greaterThan"));
        addOperator(simpleRelation(GreaterThanEqual, ">=", "greaterThanEqual"));

        addOperator(like());
        addOperator(likeEscape());
        addOperator(notLike());
        addOperator(between());

        addOperator(exists());
        addOperator(notExists());
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorinstring()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Instring, "INSTR");
    
public booleanisAggregateOperator()
Aggregate functions are function in the select such as COUNT.

        return getType() == AggregateOperator;
    
public booleanisAll()
INTERNAL: Indicates whether operator has selector All

        return  selector == ExpressionOperator.All;
    
public booleanisAny()
INTERNAL: Indicates whether operator has selector Any or Some

        return  selector == ExpressionOperator.Any ||
                selector == ExpressionOperator.Some;
    
public booleanisAnyOrAll()
INTERNAL: Indicates whether operator has selector Any, Some or All

        return  isAny() || isAll();
    
public booleanisComparisonOperator()
Comparison functions are functions such as = and >.

        return getType() == ComparisonOperator;
    
public booleanisComplete()
INTERNAL: If we have all the required information, this operator is complete and can be used as is. Otherwise we will need to look up a platform- specific operator.

        return (databaseStrings != null) && (databaseStrings.length != 0);
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorisFragment()

        ExpressionOperator result = new ExpressionOperator();
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement(".isFragment()");
        result.printsAs(v);
        result.bePostfix();
        result.setSelector(IsFragment);
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public booleanisFunctionOperator()
General functions are any normal function such as UPPER.

        return getType() == FunctionOperator;
    
public booleanisLogicalOperator()
Logical functions are functions such as and and or.

        return getType() == LogicalOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorisNull()
INTERNAL: Create the ISNULL operator.

        ExpressionOperator result = new ExpressionOperator();
        result.setType(ComparisonOperator);
        result.setSelector(IsNull);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement("(");
        v.addElement(" IS NULL)");
        result.printsAs(v);
        result.bePrefix();
        result.printsJavaAs(".isNull()");
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public booleanisOrderOperator()
Order functions are used in the order by such as ASC.

        return getType() == OrderOperator;
    
public booleanisPrefix()
ADVANCED: Return true if this is a prefix operator.

        return isPrefix;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorlastDay()
INTERNAL: Build operator.

        return simpleFunction(LastDay, "LAST_DAY");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorleast()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Least, "LEAST");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorleftPad()
INTERNAL: Build operator.

        return simpleThreeArgumentFunction(LeftPad, "LPAD");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorleftTrim()
INTERNAL: Build operator.

        return simpleFunction(LeftTrim, "LTRIM");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorleftTrim2()
INTERNAL: Build leftTrim operator that takes one parameter.

        return simpleTwoArgumentFunction(LeftTrim2, "LTRIM");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorlength()
INTERNAL: Build operator.

        return simpleFunction(Length, "LENGTH");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorlike()
INTERNAL: Create the LIKE operator.

        return simpleRelation(Like, "LIKE", "like");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorlikeEscape()
INTERNAL: Create the LIKE operator.

        ExpressionOperator result = new ExpressionOperator();
        result.setSelector(LikeEscape);
        result.setType(ComparisonOperator);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement("(");
        v.addElement(" LIKE ");
        v.addElement(" ESCAPE ");
        v.addElement(")");
        result.printsAs(v);
        result.bePrefix();
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorln()
INTERNAL: Build operator.

        return simpleFunction(Ln, "LN");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorlocate()
INTERNAL: Build locate operator i.e. LOCATE("ob", t0.F_NAME)

        ExpressionOperator expOperator = simpleTwoArgumentFunction(Locate, "LOCATE");
        int[] argumentIndices = new int[2];
        argumentIndices[0] = 1;
        argumentIndices[1] = 0;
        expOperator.setArgumentIndices(argumentIndices);
        return expOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorlocate2()
INTERNAL: Build locate operator with 3 params i.e. LOCATE("coffee", t0.DESCRIP, 4). Last parameter is a start at.

        ExpressionOperator expOperator = simpleThreeArgumentFunction(Locate2, "LOCATE");
        int[] argumentIndices = new int[3];
        argumentIndices[0] = 1;
        argumentIndices[1] = 0;
        argumentIndices[2] = 2;
        expOperator.setArgumentIndices(argumentIndices);
        return expOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorlog()
INTERNAL: Build operator.

        return simpleFunction(Log, "LOG");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatormaximum()
INTERNAL: Create the MAXIMUM operator.

        return simpleAggregate(Maximum, "MAX", "maximum");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorminimum()
INTERNAL: Create the MINIMUM operator.

        return simpleAggregate(Minimum, "MIN", "minimum");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatormod()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Mod, "MOD");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatormonthsBetween()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(MonthsBetween, "MONTHS_BETWEEN");
    
public oracle.toplink.essentials.expressions.ExpressionnewExpressionForArgument(oracle.toplink.essentials.expressions.Expression base, java.lang.Object singleArgument)
INTERNAL: Create a new expression. Optimized for the single argument case.

        if (representsEqualToNull(singleArgument)) {
            return base.isNull();
        }
        if (representsNotEqualToNull(singleArgument)) {
            return base.notNull();
        }

        try {
            Expression exp = null;
            if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
                try {
                    exp = (Expression)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(getNodeClass()));
                } catch (PrivilegedActionException exception) {
                    return null;
                }
            } else {
                exp = (Expression)PrivilegedAccessHelper.newInstanceFromClass(getNodeClass());
            }
            exp.create(base, singleArgument, this);
            return exp;
        } catch (InstantiationException e) {
            return null;
        } catch (IllegalAccessException f) {
            return null;
        }
    
public oracle.toplink.essentials.expressions.ExpressionnewExpressionForArgumentWithBaseLast(oracle.toplink.essentials.expressions.Expression base, java.lang.Object singleArgument)
INTERNAL: Create a new expression. Optimized for the single argument case with base last

        if (representsEqualToNull(singleArgument)) {
            return base.isNull();
        }
        if (representsNotEqualToNull(singleArgument)) {
            return base.notNull();
        }

        try {
            Expression exp = null;
            if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
                try {
                    exp = (Expression)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(getNodeClass()));
                } catch (PrivilegedActionException exception) {
                    return null;
                }
            } else {
                exp = (Expression)PrivilegedAccessHelper.newInstanceFromClass(getNodeClass());
            }
            exp.createWithBaseLast(base, singleArgument, this);
            return exp;
        } catch (InstantiationException e) {
            return null;
        } catch (IllegalAccessException f) {
            return null;
        }
    
public oracle.toplink.essentials.expressions.ExpressionnewExpressionForArguments(oracle.toplink.essentials.expressions.Expression base, java.util.Vector arguments)
INTERNAL: The general case.

        if (representsEqualToNull(arguments)) {
            return base.isNull();
        }
        if (representsNotEqualToNull(arguments)) {
            return base.notNull();
        }

        try {
            Expression exp = null;
            if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
                try {
                    exp = (Expression)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(getNodeClass()));
                } catch (PrivilegedActionException exception) {
                    return null;
                }
            } else {
                exp = (Expression)PrivilegedAccessHelper.newInstanceFromClass(getNodeClass());
            }
            exp.create(base, arguments, this);
            return exp;
        } catch (InstantiationException e) {
            return null;
        } catch (IllegalAccessException f) {
            return null;
        }
    
public static oracle.toplink.essentials.expressions.ExpressionOperatornewTime()
INTERNAL: Build operator.

        return simpleThreeArgumentFunction(NewTime, "NEW_TIME");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatornextDay()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(NextDay, "NEXT_DAY");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatornotExists()
INTERNAL: Create the NOT EXISTS operator.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(NotExists);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        v.addElement("NOT EXISTS" + " ");
        v.addElement(" ");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatornotIn()
INTERNAL: Create the NOTIN operator.

        ExpressionOperator result = new ExpressionOperator();
        result.setType(ExpressionOperator.FunctionOperator);
        result.setSelector(NotIn);
        Vector v = new Vector(2);
        v.addElement(" NOT IN (");
        v.addElement(")");
        result.printsAs(v);
        result.bePostfix();
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatornotInSubQuery()
INTERNAL: Create the NOTIN operator taking a subQuery. Note, the subquery itself comes with parenethesis, so the IN operator should not add any parenethesis.

        ExpressionOperator result = new ExpressionOperator();
        result.setType(ExpressionOperator.FunctionOperator);
        result.setSelector(NotInSubQuery);
        Vector v = new Vector(1);
        v.addElement(" NOT IN ");
        result.printsAs(v);
        result.bePostfix();
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatornotLike()
INTERNAL: Create the NOTLIKE operator.

        return simpleRelation(NotLike, "NOT LIKE", "notLike");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatornotNull()
INTERNAL: Create the NOTNULL operator.

        ExpressionOperator result = new ExpressionOperator();
        result.setType(ComparisonOperator);
        result.setSelector(NotNull);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement("(");
        v.addElement(" IS NOT NULL)");
        result.printsAs(v);
        result.bePrefix();
        result.printsJavaAs(".notNull()");
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatornotOperator()
INTERNAL: Create the NOT operator.

        ExpressionOperator result = new ExpressionOperator();
        result.setSelector(Not);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        v.addElement("NOT (");
        v.addElement(")");
        result.printsAs(v);
        result.bePrefix();
        result.printsJavaAs(".not()");
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatoror()
INTERNAL: Create the OR operator.

        return simpleLogical(Or, "OR", "or");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatororacleDateName()
INTERNAL: Oracle equivalent to DATENAME is TO_CHAR.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(DateName);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(3);
        v.addElement("TO_CHAR(");
        v.addElement(", '");
        v.addElement("')");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        int[] indices = { 1, 0 };
        exOperator.setArgumentIndices(indices);
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorpower()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Power, "POWER");
    
public voidprintCollection(java.util.Vector items, oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer)
INTERNAL: Print the collection onto the SQL stream.

        int dbStringIndex = 0;
        try {
            if (isPrefix()) {
                printer.getWriter().write(getDatabaseStrings()[0]);
                dbStringIndex = 1;
            } else {
                dbStringIndex = 0;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        for (int i = 0; i < items.size(); i++) {
            int index = 0;
            if (argumentIndices == null) {
                index = i;
            } else {
                index = argumentIndices[i];
            }
            ;
            Expression item = (Expression)items.elementAt(index);
            if ((getSelector() == Ref) || ((getSelector() == Deref) && (item.isObjectExpression()))) {
                DatabaseTable alias = ((ObjectExpression)item).aliasForTable((DatabaseTable)((ObjectExpression)item).getDescriptor().getTables().firstElement());
                printer.printString(alias.getName());
            } else if ((getSelector() == Count) && (item.isExpressionBuilder())) {
                printer.printString("*");
            } else if (getType() == FunctionOperator) {
                item.printSQLWithoutConversion(printer);
            } else {
                item.printSQL(printer);
            }
            if (dbStringIndex < getDatabaseStrings().length) {
                printer.printString(getDatabaseStrings()[dbStringIndex++]);
            }
        }
    
public voidprintDuo(oracle.toplink.essentials.expressions.Expression first, oracle.toplink.essentials.expressions.Expression second, oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer)
INTERNAL: For performance, special case printing two children, since it's by far the most common

        int dbStringIndex;
        if (isPrefix()) {
            printer.printString(getDatabaseStrings()[0]);
            dbStringIndex = 1;
        } else {
            dbStringIndex = 0;
        }

        first.printSQL(printer);
        if (dbStringIndex < getDatabaseStrings().length) {
            printer.printString(getDatabaseStrings()[dbStringIndex++]);
        }
        if (second != null) {
            second.printSQL(printer);
            if (dbStringIndex < getDatabaseStrings().length) {
                printer.printString(getDatabaseStrings()[dbStringIndex++]);
            }
        }
    
public voidprintJavaCollection(java.util.Vector items, oracle.toplink.essentials.internal.expressions.ExpressionJavaPrinter printer)
INTERNAL: Print the collection onto the SQL stream.

        int javaStringIndex = 0;

        for (int i = 0; i < items.size(); i++) {
            Expression item = (Expression)items.elementAt(i);
            item.printJava(printer);
            if (javaStringIndex < getJavaStrings().length) {
                printer.printString(getJavaStrings()[javaStringIndex++]);
            }
        }
    
public voidprintJavaDuo(oracle.toplink.essentials.expressions.Expression first, oracle.toplink.essentials.expressions.Expression second, oracle.toplink.essentials.internal.expressions.ExpressionJavaPrinter printer)
INTERNAL: For performance, special case printing two children, since it's by far the most common

        int javaStringIndex = 0;

        first.printJava(printer);
        if (javaStringIndex < getJavaStrings().length) {
            printer.printString(getJavaStrings()[javaStringIndex++]);
        }
        if (second != null) {
            second.printJava(printer);
            if (javaStringIndex < getJavaStrings().length) {
                printer.printString(getJavaStrings()[javaStringIndex]);
            }
        }
    
public voidprintsAs(java.lang.String s)
ADVANCED: Set the single string for this operator.

        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1);
        v.addElement(s);
        printsAs(v);
    
public voidprintsAs(java.util.Vector dbStrings)
ADVANCED: Set the strings for this operator.

        this.databaseStrings = new String[dbStrings.size()];
        for (int i = 0; i < dbStrings.size(); i++) {
            getDatabaseStrings()[i] = (String)dbStrings.elementAt(i);
        }
    
public voidprintsJavaAs(java.lang.String s)
ADVANCED: Set the single string for this operator.

        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1);
        v.addElement(s);
        printsJavaAs(v);
    
public voidprintsJavaAs(java.util.Vector dbStrings)
ADVANCED: Set the strings for this operator.

        this.javaStrings = new String[dbStrings.size()];
        for (int i = 0; i < dbStrings.size(); i++) {
            getJavaStrings()[i] = (String)dbStrings.elementAt(i);
        }
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorref()
INTERNAL: Build operator.

        return simpleFunction(Ref, "REF");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorrefToHex()
INTERNAL: Build operator.

        return simpleFunction(RefToHex, "REFTOHEX");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorreplace()
INTERNAL: Build operator.

        return simpleThreeArgumentFunction(Replace, "REPLACE");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorreplicate()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Replicate, "REPLICATE");
    
public booleanrepresentsEqualToNull(java.lang.Object singleArgument)
INTERNAL: Test if this operator instance represents a comparison to null, which we have to print specially. Also special-cased for performance.

        if (singleArgument instanceof Vector) {
            return representsEqualToNull((Vector)singleArgument);
        }
        return (getSelector() == Equal) && (singleArgument == null);
    
public booleanrepresentsEqualToNull(java.util.Vector arguments)
INTERNAL: Test if this operator instance represents a comparison to null, which we have to print specially.

        return (getSelector() == Equal) && (arguments.size() == 1) && (arguments.elementAt(0) == null);
    
public booleanrepresentsNotEqualToNull(java.lang.Object singleArgument)
INTERNAL: Test if this operator instance represents a comparison to null, which we have to print specially. Also special-cased for performance.

        if (singleArgument instanceof Vector) {
            return representsNotEqualToNull((Vector)singleArgument);
        }
        return (getSelector() == NotEqual) && (singleArgument == null);
    
public booleanrepresentsNotEqualToNull(java.util.Vector arguments)
INTERNAL: Test if this operator instance represents a comparison to null, which we have to print specially.

        return (getSelector() == NotEqual) && (arguments.size() == 1) && (arguments.elementAt(0) == null);
    
public static voidresetOperators()
INTERNAL: Reset all the operators.

        allOperators = new Hashtable();
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorreverse()
INTERNAL: Build operator.

        return simpleFunction(Reverse, "REVERSE");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorright()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Right, "RIGHT");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorrightPad()
INTERNAL: Build operator.

        return simpleThreeArgumentFunction(RightPad, "RPAD");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorrightTrim()
INTERNAL: Build operator.

        return simpleFunction(RightTrim, "RTRIM");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorrightTrim2()
INTERNAL: Build rightTrim operator that takes one parameter.

bug
2916893 rightTrim(substring) broken.

        return simpleTwoArgumentFunction(RightTrim2, "RTRIM");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorround()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Round, "ROUND");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorroundDate()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(RoundDate, "ROUND");
    
public voidsetArgumentIndices(int[] indices)
ADVANCED: Set the array of indexes to use when building the SQL function.

        argumentIndices = indices;
    
public voidsetNodeClass(java.lang.Class nodeClass)
ADVANCED: Set the node class for this operator. For user-defined functions this is set automatically but can be changed.

A list of Operator types, an example, and the node class used follows.

LogicalOperator AND LogicalExpression

ComparisonOperator <> RelationExpression

AggregateOperator COUNT FunctionExpression

OrderOperator ASCENDING "

FunctionOperator RTRIM "

Node classes given belong to oracle.toplink.essentials.internal.expressions.

        this.nodeClass = nodeClass;
    
public voidsetSelector(int selector)
INTERNAL: Set the selector id.

        this.selector = selector;
    
public voidsetType(int type)
ADVANCED: Set the type of function. This must be one of the static function types defined in this class.

        this.type = type;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsign()
INTERNAL: Build operator.

        return simpleFunction(Sign, "SIGN");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleAggregate(int selector, java.lang.String databaseName, java.lang.String javaName)
INTERNAL: Create an operator for a simple aggregate given a Java name and a single String for the database (parentheses will be added automatically).

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(AggregateOperator);
        exOperator.setSelector(selector);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        v.addElement(databaseName + "(");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.printsJavaAs("." + javaName + "()");
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleFunction(int selector, java.lang.String databaseName)
INTERNAL: Create an operator for a simple function given a Java name and a single String for the database (parentheses will be added automatically).

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(selector);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        v.addElement(databaseName + "(");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleFunction(int selector, java.lang.String databaseName, java.lang.String javaName)
INTERNAL: Create an operator for a simple function given a Java name and a single String for the database (parentheses will be added automatically).

        ExpressionOperator exOperator = simpleFunction(selector, databaseName);
        exOperator.printsJavaAs("." + javaName + "()");
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleFunctionNoParentheses(int selector, java.lang.String databaseName)
INTERNAL: Create an operator for a simple function call without parentheses

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(selector);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1);
        v.addElement(databaseName);
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleLogical(int selector, java.lang.String databaseName, java.lang.String javaName)
INTERNAL: Create an operator for a simple logical given a Java name and a single String for the database (parentheses will be added automatically).

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(LogicalOperator);
        exOperator.setSelector(selector);
        exOperator.printsAs(" " + databaseName + " ");
        exOperator.bePostfix();
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        v.addElement("." + javaName + "(");
        v.addElement(")");
        exOperator.printsJavaAs(v);
        exOperator.setNodeClass(ClassConstants.LogicalExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleLogicalNoParens(int selector, java.lang.String dbString)
INTERNAL: e.g.: ... "Bob" CONCAT "Smith" ... Parentheses will not be addded. [RMB - March 5 2000]

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(selector);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(5);
        v.addElement("");
        v.addElement(" " + dbString + " ");
        v.addElement("");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleMath(int selector, java.lang.String databaseName)
INTERNAL: Create an operator for a simple math operatin, i.e. +, -, *, /

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(selector);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(3);
        v.addElement("(");
        v.addElement(" " + databaseName + " ");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleOrdering(int selector, java.lang.String databaseName, java.lang.String javaName)
INTERNAL: Create an operator for a simple ordering given a Java name and a single String for the database (parentheses will be added automatically).

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(OrderOperator);
        exOperator.setSelector(selector);
        exOperator.printsAs(" " + databaseName);
        exOperator.bePostfix();
        exOperator.printsJavaAs("." + javaName + "()");
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleRelation(int selector, java.lang.String databaseName)
INTERNAL: Create an operator for a simple relation given a Java name and a single String for the database (parentheses will be added automatically).

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(ComparisonOperator);
        exOperator.setSelector(selector);
        exOperator.printsAs(" " + databaseName + " ");
        exOperator.bePostfix();
        exOperator.setNodeClass(ClassConstants.RelationExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleRelation(int selector, java.lang.String databaseName, java.lang.String javaName)
INTERNAL: Create an operator for a simple relation given a Java name and a single String for the database (parentheses will be added automatically).

        ExpressionOperator exOperator = simpleRelation(selector, databaseName);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        v.addElement("." + javaName + "(");
        v.addElement(")");
        exOperator.printsJavaAs(v);        
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleThreeArgumentFunction(int selector, java.lang.String dbString)
INTERNAL: Build operator.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(selector);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(4);
        v.addElement(dbString + "(");
        v.addElement(", ");
        v.addElement(", ");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsimpleTwoArgumentFunction(int selector, java.lang.String dbString)
INTERNAL: Build operator.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(selector);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(5);
        v.addElement(dbString + "(");
        v.addElement(", ");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsin()
INTERNAL: Build operator.

        return simpleFunction(Sin, "SIN");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsinh()
INTERNAL: Build operator.

        return simpleFunction(Sinh, "SINH");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsome()
INTERNAL: Create the SOME operator.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(Some);
        exOperator.printsAs("SOME");
        exOperator.bePostfix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsoundex()
INTERNAL: Build operator.

        return simpleFunction(Soundex, "SOUNDEX");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsqrt()
INTERNAL: Build operator.

        return simpleFunction(Sqrt, "SQRT");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorstandardDeviation()
INTERNAL: Build operator.

        return simpleAggregate(StandardDeviation, "STDDEV", "standardDeviation");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsubstring()
INTERNAL: Build operator.

        return simpleThreeArgumentFunction(Substring, "SUBSTR");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsum()
INTERNAL: Create the SUM operator.

        return simpleAggregate(Sum, "SUM", "sum");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsybaseAddMonthsOperator()
INTERNAL: Function, to add months to a date.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(AddMonths);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(3);
        v.addElement("DATEADD(month, ");
        v.addElement(", ");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        int[] indices = { 1, 0 };
        exOperator.setArgumentIndices(indices);
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;

    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsybaseAtan2Operator()
INTERNAL: Build operator.

        return ExpressionOperator.simpleTwoArgumentFunction(Atan2, "ATN2");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsybaseInStringOperator()
INTERNAL: Build instring operator

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(Instring);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(3);
        v.addElement("CHARINDEX(");
        v.addElement(", ");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        int[] indices = { 1, 0 };
        exOperator.setArgumentIndices(indices);
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;

    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsybaseLocateOperator()
INTERNAL: Build the Sybase equivalent to Locate

        ExpressionOperator result = simpleTwoArgumentFunction(ExpressionOperator.Locate, "CHARINDEX");
        int[] argumentIndices = new int[2];
        argumentIndices[0] = 1;
        argumentIndices[1] = 0;
        result.setArgumentIndices(argumentIndices);
        return result;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsybaseToCharOperator()
INTERNAL: Build Sybase equivalent to TO_CHAR.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(ToChar);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        v.addElement("CONVERT(CHAR, ");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsybaseToCharWithFormatOperator()
INTERNAL: Build Sybase equivalent to TO_CHAR.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(ToCharWithFormat);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(3);
        v.addElement("CONVERT(CHAR, ");
        v.addElement(",");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsybaseToDateOperator()
INTERNAL: Build Sybase equivalent to TO_DATE.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(ToDate);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        v.addElement("CONVERT(DATETIME, ");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsybaseToDateToStringOperator()
INTERNAL: Build Sybase equivalent to TO_CHAR.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(DateToString);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        v.addElement("CONVERT(CHAR, ");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorsybaseToNumberOperator()
INTERNAL: Build Sybase equivalent to TO_NUMBER.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(ToNumber);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        v.addElement("CONVERT(NUMERIC, ");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortan()
INTERNAL: Build operator.

        return simpleFunction(Tan, "TAN");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortanh()
INTERNAL: Build operator.

        return simpleFunction(Tanh, "TANH");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortoChar()
INTERNAL: Build operator.

        return simpleFunction(ToChar, "TO_CHAR");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortoCharWithFormat()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(ToCharWithFormat, "TO_CHAR");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortoDate()
INTERNAL: Build operator.

        return simpleFunction(ToDate, "TO_DATE");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortoLowerCase()
INTERNAL: Create the toLowerCase operator.

        return simpleFunction(ToLowerCase, "LOWER", "toLowerCase");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortoNumber()
INTERNAL: Build operator.

        return simpleFunction(ToNumber, "TO_NUMBER");
    
public java.lang.StringtoString()
Print a debug representation of this operator.

        if ((getDatabaseStrings() == null) || (getDatabaseStrings().length == 0)) {
            //CR#... Print a useful name for the missing plaftorm operator.
            return "platform operator - " + getPlatformOperatorName(getSelector());
        } else {
            return "operator " + getDatabaseStrings()[0];
        }
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortoUpperCase()
INTERNAL: Create the TOUPPERCASE operator.

        return simpleFunction(ToUpperCase, "UPPER", "toUpperCase");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortoday()
INTERNAL: Build operator.

        return currentTimeStamp();
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortranslate()
INTERNAL: Build operator.

        return simpleThreeArgumentFunction(Translate, "TRANSLATE");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortrim()
INTERNAL: Build operator.

        return simpleFunction(Trim, "TRIM");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortrim2()
INTERNAL: Build Trim operator.

        ExpressionOperator exOperator = new ExpressionOperator();
        exOperator.setType(FunctionOperator);
        exOperator.setSelector(Trim2);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(5);
        v.addElement("TRIM(");
        v.addElement(" FROM ");
        v.addElement(")");
        exOperator.printsAs(v);
        exOperator.bePrefix();
        exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        return exOperator;
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortrunc()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(Trunc, "TRUNC");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatortruncateDate()
INTERNAL: Build operator.

        return simpleTwoArgumentFunction(TruncateDate, "TRUNC");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorvalue()
INTERNAL: Build operator.

        return simpleFunction(Value, "VALUE");
    
public static oracle.toplink.essentials.expressions.ExpressionOperatorvariance()
INTERNAL: Build operator.

        return simpleAggregate(Variance, "VARIANCE", "variance");