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

Expression

public abstract class Expression extends Object implements Serializable, Cloneable

Purpose: Define an object-level representation of a database query where clause.

Description: An expression is a tree-like structure that defines the selection criteria for a query against objects in the database. The expression has the advantage over SQL by being at the object-level, i.e. the object model attributes and relationships can be used to be query on instead of the database field names. Because it is an object, not a string the expression has the advantage that is can be easily manipulated through code to easily build complex selection criterias.

Responsibilities:

  • Store the selection criteria in a tree-like structure.
  • Support public manipulation protocols for all comparison and function opperators.
  • Use opperator overloading to support all primitive types as well as objects.

Fields Summary
static final long
serialVersionUID
Required for serialization compatibility.
protected transient DatabaseTable
lastTable
Temporary values for table aliasing
protected transient DatabaseTable
currentAlias
protected boolean
selectIfOrderedBy
Constructors Summary
public Expression()
Base Expression Constructor. Not generally used by Developers


                  
      
        super();
    
Methods Summary
public oracle.toplink.essentials.expressions.ExpressionaddDate(java.lang.String datePart, int numberToAdd)
PUBLIC: Function, return an expression that adds to a date based on the specified datePart. This is eqivalent to the Sybase DATEADD funtion.

Example:

TopLink: employee.get("date").addDate("year", 2) Java: NA SQL: DATEADD(date, 2, year)

        return addDate(datePart, new Integer(numberToAdd));
    
public oracle.toplink.essentials.expressions.ExpressionaddDate(java.lang.String datePart, java.lang.Object numberToAdd)
PUBLIC: Function, return an expression that adds to a date based on the specified datePart. This is eqivalent to the Sybase DATEADD funtion.

Example:

TopLink: employee.get("date").addDate("year", 2) Java: NA SQL: DATEADD(date, 2, year)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.AddDate);
        FunctionExpression expression = new FunctionExpression();
        expression.setBaseExpression(this);
        expression.addChild(this);
        expression.addChild(Expression.fromLiteral(datePart, this));
        expression.addChild(Expression.from(numberToAdd, this));
        expression.setOperator(anOperator);
        return expression;
    
public oracle.toplink.essentials.expressions.ExpressionaddMonths(int months)
PUBLIC: Function, to add months to a date.

        return addMonths(new Integer(months));
    
public oracle.toplink.essentials.expressions.ExpressionaddMonths(java.lang.Object months)
PUBLIC: Function, to add months to a date.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.AddMonths);
        return anOperator.expressionFor(this, months);
    
public oracle.toplink.essentials.internal.helper.DatabaseTablealiasForTable(oracle.toplink.essentials.internal.helper.DatabaseTable table)
INTERNAL: Find the alias for a given table

        return null;
    
public oracle.toplink.essentials.expressions.Expressionall(byte[] theBytes)
PUBLIC: Return an expression that is used with a comparison expression. The SOME keyword denotes that the search condition is TRUE if the comparison is TRUE for at least one of the values that is returned. If the subquery returns no value, the search condition is FALSE

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theBytes.length; index++) {
            vector.addElement(new Byte(theBytes[index]));
        }

        return all(vector);
    
public oracle.toplink.essentials.expressions.Expressionall(char[] theChars)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theChars.length; index++) {
            vector.addElement(new Character(theChars[index]));
        }

        return all(vector);
    
public oracle.toplink.essentials.expressions.Expressionall(double[] theDoubles)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theDoubles.length; index++) {
            vector.addElement(new Double(theDoubles[index]));
        }

        return all(vector);
    
public oracle.toplink.essentials.expressions.Expressionall(float[] theFloats)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theFloats.length; index++) {
            vector.addElement(new Float(theFloats[index]));
        }

        return all(vector);
    
public oracle.toplink.essentials.expressions.Expressionall(int[] theInts)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theInts.length; index++) {
            vector.addElement(new Integer(theInts[index]));
        }

        return all(vector);
    
public oracle.toplink.essentials.expressions.Expressionall(long[] theLongs)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theLongs.length; index++) {
            vector.addElement(new Long(theLongs[index]));
        }

        return all(vector);
    
public oracle.toplink.essentials.expressions.Expressionall(java.lang.Object[] theObjects)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theObjects.length; index++) {
            vector.addElement(theObjects[index]);
        }

        return all(vector);
    
public oracle.toplink.essentials.expressions.Expressionall(short[] theShorts)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theShorts.length; index++) {
            vector.addElement(new Short(theShorts[index]));
        }

        return all(vector);
    
public oracle.toplink.essentials.expressions.Expressionall(boolean[] theBooleans)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theBooleans.length; index++) {
            vector.addElement(new Boolean(theBooleans[index]));
        }

        return all(vector);
    
public oracle.toplink.essentials.expressions.Expressionall(java.util.Vector theObjects)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

Example:

TopLink: employee.get("age").in(agesVector) Java: agesVector.contains(employee.getAge()) SQL: AGE IN (55, 18, 30)

        return all(new ConstantExpression(theObjects, this));
    
public oracle.toplink.essentials.expressions.Expressionall(oracle.toplink.essentials.expressions.Expression arguments)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.All);
        return anOperator.expressionFor(this, arguments);
    
public oracle.toplink.essentials.expressions.Expressionall(oracle.toplink.essentials.queryframework.ReportQuery subQuery)

        return all(subQuery(subQuery));
    
public oracle.toplink.essentials.expressions.ExpressionallOf(java.lang.String attributeName, oracle.toplink.essentials.expressions.Expression criteria)
PUBLIC: Returns an expression equivalent to all of attributeName holding true for criteria.

For every expression with an anyOf, its negation has either an allOf or a noneOf. The following two examples will illustrate as the second is the negation of the first:

AnyOf Example: Employees with a non '613' area code phone number.

ReadAllQuery query = new ReadAllQuery(Employee.class); ExpressionBuilder employee = new ExpressionBuilder(); Expression exp = employee.anyOf("phoneNumbers").get("areaCode").notEqual("613");

AllOf Example: Employees with all '613' area code phone numbers.

ExpressionBuilder employee = new ExpressionBuilder(); ExpressionBuilder phones = new ExpressionBuilder(); Expression exp = employee.allOf("phoneNumbers", phones.get("areaCode").equal("613")); SQL: SELECT ... EMPLOYEE t0 WHERE NOT EXISTS (SELECT ... PHONE t1 WHERE (t0.EMP_ID = t1.EMP_ID) AND NOT (t1.AREACODE = '613'))

allOf is the universal counterpart to the existential anyOf. To have the condition evaluated for each instance it must be put inside of a subquery, which can be expressed as not exists (any of attributeName some condition). (All x such that y = !Exist x such that !y).

Likewise the syntax employee.allOf("phoneNumbers").get("areaCode").equal("613") is not supported for the equal must go inside a subQuery.

This method saves you from writing the sub query yourself. The above is equivalent to the following expression:

ExpressionBuilder employee = new ExpressionBuilder(); ExpressionBuilder phone = new ExpressionBuilder(); ReportQuery subQuery = new ReportQuery(Phone.class, phone); subQuery.retreivePrimaryKeys(); subQuery.setSelectionCriteria(phone.equal(employee.anyOf("phoneNumbers").and( phone.get("areaCode").notEqual("613"))); Expression exp = employee.notExists(subQuery);

Note if employee has no phone numbers allOf ~ noneOf.

param
criteria must have its own builder, as it will become the seperate selection criteria of a subQuery.
return
a notExists subQuery expression

        ReportQuery subQuery = new ReportQuery();
        subQuery.setShouldRetrieveFirstPrimaryKey(true);
        Expression builder = criteria.getBuilder();
        criteria = builder.equal(anyOf(attributeName)).and(criteria.not());
        subQuery.setSelectionCriteria(criteria);
        return notExists(subQuery);
    
public oracle.toplink.essentials.expressions.Expressionand(oracle.toplink.essentials.expressions.Expression theExpression)
PUBLIC: Return an expression that is the boolean logical combination of both expressions. This is equivalent to the SQL "AND" operator and the Java "&&" operator.

Example:

TopLink: employee.get("firstName").equal("Bob").and(employee.get("lastName").equal("Smith")) Java: (employee.getFirstName().equals("Bob")) && (employee.getLastName().equals("Smith")) SQL: F_NAME = 'Bob' AND L_NAME = 'Smith'

        // Allow ands with null.
        if (theExpression == null) {
            return this;
        }

        ExpressionBuilder base = getBuilder();
        Expression expressionToUse = theExpression;

        // Ensure the same builder, unless a parralel query is used.
        // For flashback added an extra condition: if left side is a 'NullExpression'
        // then rebuild on it regardless.
        if ((theExpression.getBuilder() != base) && ((base == this) || (theExpression.getBuilder().getQueryClass() == null))) {
            expressionToUse = theExpression.rebuildOn(base);
        }

        if (base == this) {// Allow and to be sent to the builder.
            return expressionToUse;
        }

        ExpressionOperator anOperator = getOperator(ExpressionOperator.And);
        return anOperator.expressionFor(this, expressionToUse);
    
public oracle.toplink.essentials.expressions.Expressionany(byte[] theBytes)
PUBLIC: Return an expression that is used with a comparison expression. The ANY keyword denotes that the search condition is TRUE if the comparison is TRUE for at least one of the values that is returned. If the subquery returns no value, the search condition is FALSE

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theBytes.length; index++) {
            vector.addElement(new Byte(theBytes[index]));
        }

        return any(vector);
    
public oracle.toplink.essentials.expressions.Expressionany(char[] theChars)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theChars.length; index++) {
            vector.addElement(new Character(theChars[index]));
        }

        return any(vector);
    
public oracle.toplink.essentials.expressions.Expressionany(double[] theDoubles)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theDoubles.length; index++) {
            vector.addElement(new Double(theDoubles[index]));
        }

        return any(vector);
    
public oracle.toplink.essentials.expressions.Expressionany(float[] theFloats)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theFloats.length; index++) {
            vector.addElement(new Float(theFloats[index]));
        }

        return any(vector);
    
public oracle.toplink.essentials.expressions.Expressionany(int[] theInts)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theInts.length; index++) {
            vector.addElement(new Integer(theInts[index]));
        }

        return any(vector);
    
public oracle.toplink.essentials.expressions.Expressionany(long[] theLongs)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theLongs.length; index++) {
            vector.addElement(new Long(theLongs[index]));
        }

        return any(vector);
    
public oracle.toplink.essentials.expressions.Expressionany(java.lang.Object[] theObjects)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theObjects.length; index++) {
            vector.addElement(theObjects[index]);
        }

        return any(vector);
    
public oracle.toplink.essentials.expressions.Expressionany(short[] theShorts)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theShorts.length; index++) {
            vector.addElement(new Short(theShorts[index]));
        }

        return any(vector);
    
public oracle.toplink.essentials.expressions.Expressionany(boolean[] theBooleans)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theBooleans.length; index++) {
            vector.addElement(new Boolean(theBooleans[index]));
        }

        return any(vector);
    
public oracle.toplink.essentials.expressions.Expressionany(java.util.Vector theObjects)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

Example:

TopLink: employee.get("age").in(agesVector) Java: agesVector.contains(employee.getAge()) SQL: AGE IN (55, 18, 30)

        return any(new ConstantExpression(theObjects, this));
    
public oracle.toplink.essentials.expressions.Expressionany(oracle.toplink.essentials.expressions.Expression arguments)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Any);
        return anOperator.expressionFor(this, arguments);
    
public oracle.toplink.essentials.expressions.Expressionany(oracle.toplink.essentials.queryframework.ReportQuery subQuery)

        return any(subQuery(subQuery));
    
public oracle.toplink.essentials.expressions.ExpressionanyOf(java.lang.String attributeName)
PUBLIC: Return an expression representing traversal of a 1:many or many:many relationship. This allows you to query whether any of the "many" side of the relationship satisfies the remaining criteria.

Example:

Format Equivalent
TopLink ReadAllQuery query = new ReadAllQuery(Employee.class);
ExpressionBuilder builder = new ExpressionBuilder();
Expression exp = builder.get("id").equal("14858");
exp = exp.or(builder.anyOf("managedEmployees").get("firstName").equal("Bob"));
Java No direct equivalent
SQL SELECT DISTINCT ... WHERE (t2.MGR_ID (+) = t1.ID) AND (t2.F_NAME = 'Bob')

        QueryKeyExpression queryKey = (QueryKeyExpression)get(attributeName);

        queryKey.doQueryToManyRelationship();
        return queryKey;

    
public oracle.toplink.essentials.expressions.ExpressionanyOfAllowingNone(java.lang.String attributeName)
ADVANCED: Return an expression representing traversal of a 1:many or many:many relationship. This allows you to query whether any of the "many" side of the relationship satisfies the remaining criteria. This version of the anyOf operation performs an outer join. Outer joins allow the join to performed even if the target of the relationship is empty. NOTE: outer joins are not supported on all database and have differing symantics.

Example:

Format Equivalent
TopLink ReadAllQuery query = new ReadAllQuery(Employee.class);
ExpressionBuilder builder = new ExpressionBuilder();
Expression exp = builder.get("id").equal("14858");
exp = exp.or(builder.anyOfAllowingNone("managedEmployees").get("firstName").equal("Bob"));
Java No direct equivalent
SQL SELECT DISTINCT ... WHERE (t2.MGR_ID (+) = t1.ID) AND (t2.F_NAME = 'Bob')

        QueryKeyExpression queryKey = (QueryKeyExpression)getAllowingNull(attributeName);

        queryKey.doQueryToManyRelationship();
        return queryKey;

    
public oracle.toplink.essentials.expressions.Expressionascending()
PUBLIC: This can only be used within an ordering expression. It will order the result ascending. Example:
readAllQuery.addOrderBy(expBuilder.get("address").get("city").ascending())

        return getFunction(ExpressionOperator.Ascending);
    
public oracle.toplink.essentials.expressions.ExpressionasciiValue()
PUBLIC: Function, returns the single character strings ascii value.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Ascii);
        return anOperator.expressionFor(this);
    
protected voidassignAlias(java.lang.String name, oracle.toplink.essentials.internal.helper.DatabaseTable tableOrExpression)
INTERNAL: Alias a particular table within this node

        // By default, do nothing.	
    
public intassignTableAliasesStartingAt(int initialValue)
INTERNAL: Assign aliases to any tables which I own. Start with t, and return the new value of the counter , i.e. if initialValue is one and I have tables ADDRESS and EMPLOYEE I will assign them t1 and t2 respectively, and return 3.

        if (hasBeenAliased()) {
            return initialValue;
        }
        int counter = initialValue;
        Vector ownedTables = getOwnedTables();
        if (ownedTables != null) {
            for (Enumeration e = ownedTables.elements(); e.hasMoreElements();) {
                assignAlias("t" + counter, (DatabaseTable)e.nextElement());
                counter++;
            }
        }
        return counter;
    
public oracle.toplink.essentials.expressions.Expressionaverage()
PUBLIC: Function, This represents the aggregate function Average. Can be used only within Report Queries.

        return getFunction(ExpressionOperator.Average);
    
public oracle.toplink.essentials.expressions.Expressionbetween(byte leftValue, byte rightValue)
PUBLIC: Function, between two bytes

        return between(new Byte(leftValue), new Byte(rightValue));
    
public oracle.toplink.essentials.expressions.Expressionbetween(char leftChar, char rightChar)
PUBLIC: Function, between two chars

        return between(new Character(leftChar), new Character(rightChar));
    
public oracle.toplink.essentials.expressions.Expressionbetween(double leftValue, double rightValue)
PUBLIC: Function, between two doubles

        return between(new Double(leftValue), new Double(rightValue));
    
public oracle.toplink.essentials.expressions.Expressionbetween(float leftValue, float rightValue)
PUBLIC: Function, between two floats

        return between(new Float(leftValue), new Float(rightValue));
    
public oracle.toplink.essentials.expressions.Expressionbetween(int leftValue, int rightValue)
PUBLIC: Function, between two ints

        return between(new Integer(leftValue), new Integer(rightValue));
    
public oracle.toplink.essentials.expressions.Expressionbetween(long leftValue, long rightValue)
PUBLIC: Function, between two longs

        return between(new Long(leftValue), new Long(rightValue));
    
public oracle.toplink.essentials.expressions.Expressionbetween(java.lang.Object leftValue, java.lang.Object rightValue)
PUBLIC: Return an expression that compares if the receiver's value is between two other values. This means the receiver's value is greater than or equal to the leftValue argument and less than or equal to the rightValue argument.

This is equivalent to the SQL "BETWEEN AND" operator and Java ">=", "<=;" operators.

Example:

TopLink: employee.get("age").between(19,50)
Java: (employee.getAge() >= 19) && (employee.getAge() <= 50)
SQL: AGE BETWEEN 19 AND 50

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Between);
        Vector args = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        args.addElement(leftValue);
        args.addElement(rightValue);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.Expressionbetween(oracle.toplink.essentials.expressions.Expression leftExpression, oracle.toplink.essentials.expressions.Expression rightExpression)

        return between((Object)leftExpression, (Object)rightExpression);

    
public oracle.toplink.essentials.expressions.Expressionbetween(short leftValue, short rightValue)
PUBLIC: Function, between two shorts

        return between(new Short(leftValue), new Short(rightValue));
    
public oracle.toplink.essentials.expressions.ExpressioncaseStatement(java.util.Hashtable caseItems, java.lang.String defaultItem)
PUBLIC: Function Convert values returned by the query to values given in the caseItems hashtable. The equivalent of the Oracle CASE function

Example:

Hashtable caseTable = new Hashtable(); caseTable.put("Robert", "Bob"); caseTable.put("Susan", "Sue"); TopLink: employee.get("name").caseStatement(caseTable, "No-Nickname") Java: NA SQL: CASE name WHEN "Robert" THEN "Bob" WHEN "Susan" THEN "Sue" ELSE "No-Nickname"

param
caseItems java.util.Hashtable a hashtable containing the items to be processed. Keys represent the items to match coming from the query. Values represent what a key will be changed to.
param
defaultItem java.lang.String the default value that will be used if none of the keys in the hashtable match


        /**
         * case (like decode) works differently than most of the functionality in the expression
         * framework. It takes a variable number of arguments and as a result, the printed strings
         * for a case call have to be built when the number of arguments are known.
         * As a result, we do not look up case in the ExpressionOperator.  Instead we build
         * the whole operator here.  The side effect of this is that case will not throw
         * an invalid operator exception for any platform.  (Even the ones that do not support
         * case)
         */
        ExpressionOperator anOperator = new ExpressionOperator();
        anOperator.setSelector(ExpressionOperator.Case);
        anOperator.setNodeClass(FunctionExpression.class);
        anOperator.setType(ExpressionOperator.FunctionOperator);
        anOperator.bePrefix();

        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(caseItems.size() + 1);
        v.addElement("CASE ");

        FunctionExpression expression = new FunctionExpression();
        expression.setBaseExpression(this);
        expression.addChild(this);
        Enumeration enumeration = caseItems.keys();
        while (enumeration.hasMoreElements()) {
            Object key = enumeration.nextElement();
            expression.addChild(Expression.from(key, this));
            expression.addChild(Expression.from(caseItems.get(key), this));
            v.addElement(" WHEN ");
            v.addElement(" THEN ");
        }
        ;
        v.addElement(" ELSE ");
        expression.addChild(Expression.from(defaultItem, this));
        v.addElement(" END");
        anOperator.printsAs(v);
        expression.setOperator(anOperator);
        return expression;
    
public java.lang.Objectclone()
INTERNAL: Clone the expression maintaining clone identity in the inter-connected expression graph.

        // 2612538 - the default size of IdentityHashtable (32) is appropriate
        Dictionary alreadyDone = new IdentityHashtable();
        return copiedVersionFrom(alreadyDone);
    
public oracle.toplink.essentials.expressions.ExpressioncloneUsing(oracle.toplink.essentials.expressions.Expression newBase)
INTERNAL: This expression is built on a different base than the one we want. Rebuild it and return the root of the new tree. This method will rebuildOn the receiver even it is a parallel select or a sub select: it will not replace every base with newBase. Also it will rebuild using anyOf as appropriate not get.

see
oracle.toplink.essentials.mappings.ForeignReferenceMapping#batchedValueFromRow
see
#rebuildOn(Expression)
bug
2637484 INVALID QUERY KEY EXCEPTION THROWN USING BATCH READS AND PARALLEL EXPRESSIONS
bug
2612567 CR4298- NULLPOINTEREXCEPTION WHEN USING SUBQUERY AND BATCH READING IN 4.6
bug
2612140 CR2973- BATCHATTRIBUTE QUERIES WILL FAIL WHEN THE INITIAL QUERY HAS A SUBQUERY
bug
2720149 INVALID SQL WHEN USING BATCH READS AND MULTIPLE ANYOFS

        // 2612538 - the default size of IdentityHashtable (32) is appropriate
        Dictionary alreadyDone = new IdentityHashtable();

        // cloneUsing is identical to cloning save that the primary builder 
        // will be replaced not with its clone but with newBase.
        // ExpressionBuilder.registerIn() will check for this newBase with
        // alreadyDone.get(alreadyDone);
        // copiedVersionFrom() must be called on the primary builder before
        // other builders.
        alreadyDone.put(alreadyDone, newBase);
        return copiedVersionFrom(alreadyDone);
    
public oracle.toplink.essentials.expressions.Expressionconcat(java.lang.Object left)
PUBLIC: Function, returns the concatenation of the two string values.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Concat);
        return anOperator.expressionFor(this, left);
    
public oracle.toplink.essentials.expressions.ExpressioncontainsAllKeyWords(java.lang.String spaceSeperatedKeyWords)
PUBLIC: Return an expression that performs a key word search.

Example:

TopLink: project.get("description").containsAllKeyWords("TopLink rdbms java")

        StringTokenizer tokenizer = new StringTokenizer(spaceSeperatedKeyWords);
        Expression expression = null;
        while (tokenizer.hasMoreTokens()) {
            String token = tokenizer.nextToken();
            if (expression == null) {
                expression = containsSubstringIgnoringCase(token);
            } else {
                expression = expression.and(containsSubstringIgnoringCase(token));
            }
        }

        if (expression == null) {
            return like("%");
        } else {
            return expression;
        }
    
public oracle.toplink.essentials.expressions.ExpressioncontainsAnyKeyWords(java.lang.String spaceSeperatedKeyWords)
PUBLIC: Return an expression that performs a key word search.

Example:

TopLink: project.get("description").containsAllKeyWords("TopLink rdbms java")

        StringTokenizer tokenizer = new StringTokenizer(spaceSeperatedKeyWords);
        Expression expression = null;
        while (tokenizer.hasMoreTokens()) {
            String token = tokenizer.nextToken();
            if (expression == null) {
                expression = containsSubstringIgnoringCase(token);
            } else {
                expression = expression.or(containsSubstringIgnoringCase(token));
            }
        }

        if (expression == null) {
            return like("%");
        } else {
            return expression;
        }
    
public oracle.toplink.essentials.expressions.ExpressioncontainsSubstring(java.lang.String theValue)
PUBLIC: Return an expression that compares if the receivers value contains the substring.

Example:

TopLink: employee.get("firstName").containsSubstring("Bob") Java: employee.getFirstName().indexOf("Bob") != -1 SQL: F_NAME LIKE '%BOB%'

        return like("%" + theValue + "%");
    
public oracle.toplink.essentials.expressions.ExpressioncontainsSubstring(oracle.toplink.essentials.expressions.Expression expression)
PUBLIC: Return an expression that compares if the receivers value contains the substring.

Example:

TopLink: employee.get("firstName").containsSubstring("Bob") Java: employee.getFirstName().indexOf("Bob") != -1 SQL: F_NAME LIKE '%BOB%'

        return like((value("%").concat(expression)).concat("%"));
    
public oracle.toplink.essentials.expressions.ExpressioncontainsSubstringIgnoringCase(java.lang.String theValue)
PUBLIC: Return an expression that compares if the receivers value contains the substring, ignoring case.

Example:

TopLink: employee.get("firstName").containsSubstringIgnoringCase("Bob") Java: employee.getFirstName().toUpperCase().indexOf("BOB") != -1 SQL: F_NAME LIKE '%BOB%'

        return toUpperCase().containsSubstring(theValue.toUpperCase());
    
public oracle.toplink.essentials.expressions.ExpressioncontainsSubstringIgnoringCase(oracle.toplink.essentials.expressions.Expression expression)
PUBLIC: Return an expression that compares if the receivers value contains the substring, ignoring case.

Example:

TopLink: employee.get("firstName").containsSubstringIgnoringCase("Bob") Java: employee.getFirstName().toUpperCase().indexOf("BOB") != -1 SQL: F_NAME LIKE '%BOB%'

        return toUpperCase().containsSubstring(expression.toUpperCase());
    
protected voidconvertNodeToUseOuterJoin()

    
public oracle.toplink.essentials.expressions.ExpressionconvertToUseOuterJoin()
INTERNAL: Modify this expression to use outer joins wherever there are equality operations between two field nodes.

        ExpressionIterator iterator = new ExpressionIterator() {
            public void iterate(Expression each) {
                each.convertNodeToUseOuterJoin();
            }
        };
        iterator.iterateOn(this);
        return this;
    
public oracle.toplink.essentials.expressions.ExpressioncopiedVersionFrom(java.util.Dictionary alreadyDone)
INTERNAL:

        Expression existing = (Expression)alreadyDone.get(this);
        if (existing == null) {
            return registerIn(alreadyDone);
        } else {
            return existing;
        }
    
public oracle.toplink.essentials.expressions.Expressioncount()
PUBLIC: This represents the aggregate function Average. Can be used only within Report Queries.

        return getFunction(ExpressionOperator.Count);
    
public oracle.toplink.essentials.expressions.Expressioncreate(oracle.toplink.essentials.expressions.Expression base, java.lang.Object singleArgument, oracle.toplink.essentials.expressions.ExpressionOperator anOperator)
INTERNAL:

        // This is a replacement for real class methods in Java. Instead of returning a new instance we create it, then
        // mutate it using this method.
        return this;
    
public oracle.toplink.essentials.expressions.Expressioncreate(oracle.toplink.essentials.expressions.Expression base, java.util.Vector arguments, oracle.toplink.essentials.expressions.ExpressionOperator anOperator)
INTERNAL:

        // This is a replacement for real class methods in Java. Instead of returning a new instance we create it, then
        // mutate it using this method.
        return this;
    
public oracle.toplink.essentials.expressions.ExpressioncreateWithBaseLast(oracle.toplink.essentials.expressions.Expression base, java.lang.Object singleArgument, oracle.toplink.essentials.expressions.ExpressionOperator anOperator)
INTERNAL:

        // This is a replacement for real class methods in Java. Instead of returning a new instance we create it, then
        // mutate it using this method.
        return this;
    
public oracle.toplink.essentials.expressions.ExpressioncurrentDate()
PUBLIC: This gives access to the current date on the database through expression.

        return getFunction(ExpressionOperator.Today);
    
public oracle.toplink.essentials.expressions.ExpressioncurrentDateDate()
PUBLIC: This gives access to the current date only on the database through expression. Note the difference between currentDate() and this method. This method does not return the time portion of current date where as currentDate() does.

       return getFunction(ExpressionOperator.CurrentDate);
   
public oracle.toplink.essentials.expressions.ExpressioncurrentTime()
PUBLIC: This gives access to the current time only on the database through expression. Note the difference between currentDate() and this method. This method does not return the date portion where as currentDate() does.

        return getFunction(ExpressionOperator.CurrentTime);
    
public oracle.toplink.essentials.expressions.ExpressioncurrentTimeStamp()
PUBLIC: This gives access to the current timestamp on the database through expression. Please note, this method is added for consistency and returns the same result as currentDate.

        return currentDate();
    
public oracle.toplink.essentials.expressions.ExpressiondateDifference(java.lang.String datePart, java.util.Date date)
PUBLIC: Function, Return the difference between the queried part of a date(i.e. years, days etc.) and same part of the given date. The equivalent of the Sybase function DateDiff

Example:

TopLink: employee.get("date").dateDifference("year", new Date(System.currentTimeMillis())) Java: NA SQL: DATEADD(date, 2, GETDATE)
*

        ExpressionOperator anOperator = getOperator(ExpressionOperator.DateDifference);
        FunctionExpression expression = new FunctionExpression();
        expression.setBaseExpression(this);
        expression.addChild(Expression.fromLiteral(datePart, this));
        expression.addChild(Expression.from(date, this));
        expression.addChild(this);
        expression.setOperator(anOperator);
        return expression;
    
public oracle.toplink.essentials.expressions.ExpressiondateDifference(java.lang.String datePart, oracle.toplink.essentials.expressions.Expression comparisonExpression)
PUBLIC: Function, Return the difference between the queried part of a date(i.e. years, days etc.) and same part of the given date. The equivalent of the Sybase function DateDiff

Example:

TopLink: employee.get("date").dateDifference("year", new Date(System.currentTimeMillis())) Java: NA SQL: DATEADD(date, 2, GETDATE)
*

        ExpressionOperator anOperator = getOperator(ExpressionOperator.DateDifference);
        FunctionExpression expression = new FunctionExpression();
        expression.setBaseExpression(this);
        expression.addChild(Expression.fromLiteral(datePart, this));
        expression.addChild(comparisonExpression);
        expression.addChild(this);
        expression.setOperator(anOperator);
        return expression;
    
public oracle.toplink.essentials.expressions.ExpressiondateName(java.lang.String datePart)
PUBLIC: return a string that represents the given part of a date. The equivalent of the Sybase DATENAME function

Example:

TopLink: employee.get("date").dateName("year") Java: new String(date.getYear()) SQL: DATENAME(date, year)
*

        ExpressionOperator anOperator = getOperator(ExpressionOperator.DateName);
        FunctionExpression expression = new FunctionExpression();
        expression.setBaseExpression(this);
        expression.addChild(Expression.fromLiteral(datePart, this));
        expression.addChild(this);
        expression.setOperator(anOperator);
        return expression;
    
public oracle.toplink.essentials.expressions.ExpressiondatePart(java.lang.String datePart)
PUBLIC: Function return an integer which represents the requested part of the date. Equivalent of the Sybase function DATEPART

Example:

TopLink: employee.get("date").datePart("year") Java: date.getYear() SQL: DATEPART(date, year)
*

        ExpressionOperator anOperator = getOperator(ExpressionOperator.DatePart);
        FunctionExpression expression = new FunctionExpression();
        expression.setBaseExpression(this);
        expression.addChild(Expression.fromLiteral(datePart, this));
        expression.addChild(this);
        expression.setOperator(anOperator);
        return expression;
    
public oracle.toplink.essentials.expressions.ExpressiondateToString()
PUBLIC: Function, returns the date converted to the string value in the default database format.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.DateToString);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.Expressiondecode(java.util.Hashtable decodeableItems, java.lang.String defaultItem)
PUBLIC: Function Convert values returned by the query to values given in the decodeableItems hashtable. The equivalent of the Oracle DECODE function. Note: This will only work on databases that support Decode with the syntax below.

Example:

Hashtable decodeTable = new Hashtable(); decodeTable.put("Robert", "Bob"); decodeTable.put("Susan", "Sue"); TopLink: employee.get("name").Decode(decodeTable, "No-Nickname") Java: NA SQL: DECODE(name, "Robert", "Bob", "Susan", "Sue", "No-Nickname")

param
decodeableItems java.util.Hashtable a hashtable containing the items to be decoded. Keys represent the items to match coming from the query. Values represent what a key will be changed to.
param
defaultItem the default value that will be used if none of the keys in the hashtable match


        /**
         * decode works differently than most of the functionality in the expression framework.
         * It takes a variable number of arguments and as a result, the printed strings for
         * a decode call have to be built when the number of arguments are known.
         * As a result, we do not look up decode in the ExpressionOperator.  Instead we build
         * the whole operator here.  The side effect of this is that decode will not thrown
         * an invalid operator exception for any platform.  (Even the ones that do not support
         * decode)
         */
        ExpressionOperator anOperator = new ExpressionOperator();
        anOperator.setSelector(ExpressionOperator.Decode);
        anOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
        anOperator.setType(ExpressionOperator.FunctionOperator);
        anOperator.bePrefix();

        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(decodeableItems.size() + 1);
        v.addElement("DECODE(");
        for (int i = 0; i < ((decodeableItems.size() * 2) + 1); i++) {
            v.addElement(", ");
        }
        ;
        v.addElement(")");
        anOperator.printsAs(v);

        FunctionExpression expression = new FunctionExpression();
        expression.setBaseExpression(this);
        expression.addChild(this);
        Enumeration enumeration = decodeableItems.keys();
        while (enumeration.hasMoreElements()) {
            Object key = enumeration.nextElement();
            expression.addChild(Expression.from(key, this));
            expression.addChild(Expression.from(decodeableItems.get(key), this));
        }
        ;
        expression.addChild(Expression.from(defaultItem, this));
        expression.setOperator(anOperator);
        return expression;
    
public oracle.toplink.essentials.expressions.Expressiondescending()
PUBLIC: This can only be used within an ordering expression. It will order the result descending.

Example:

readAllQuery.addOrderBy(expBuilder.get("address").get("city").descending())

        return getFunction(ExpressionOperator.Descending);
    
public java.lang.StringdescriptionOfNodeType()
INTERNAL: Used in debug printing of this node.

        return "Expression";
    
public booleandetectExpression(java.util.Vector theObjects)
INTERNAL: Check if any element in theObjects is Expression.

        boolean foundExpression = false;
        int size = theObjects.size();
        for (int i = 0; i < size; i++) {
            Object element = theObjects.get(i);
            if (element instanceof Expression) {
                foundExpression = true;
                break;
            }
        }
        return foundExpression;
    
public oracle.toplink.essentials.expressions.Expressiondifference(java.lang.String expression)
PUBLIC: Function return a value which indicates how much difference there is between two expressions. Equivalent of the Sybase DIFFERENCE function

Example:

TopLink: employee.get("name").difference("Frank") SQL: DIFFERENCE(name, 'Frank')
*

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Difference);
        return anOperator.expressionFor(this, expression);
    
public oracle.toplink.essentials.expressions.Expressiondistinct()
PUBLIC: Function, This represents the distinct option inside an aggregate function. Can be used only within Report Queries.

        return getFunction(ExpressionOperator.Distinct);
    
public booleandoesConform(java.lang.Object object, oracle.toplink.essentials.internal.sessions.AbstractSession session, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow, oracle.toplink.essentials.queryframework.InMemoryQueryIndirectionPolicy valueHolderPolicy)
INTERNAL: Check if the object conforms to the expression in memory. This is used for in-memory querying. By default throw an exception as all valid root expressions must override. If the expression in not able to determine if the object conform throw a not supported exception.

        return doesConform(object, session, translationRow, valueHolderPolicy, false);
    
public booleandoesConform(java.lang.Object object, oracle.toplink.essentials.internal.sessions.AbstractSession session, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow, oracle.toplink.essentials.queryframework.InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean objectIsUnregistered)
INTERNAL: New parameter added to doesConform for feature 2612601

param
isObjectRegistered true if object possibly not a clone, but is being conformed against the unit of work cache; if object is not in the UOW cache but some of its attributes are, use the registered versions of object's attributes for the purposes of this method.

        throw QueryException.cannotConformExpression();
    
public oracle.toplink.essentials.expressions.Expressionequal(byte theValue)

        return equal(new Byte(theValue));
    
public oracle.toplink.essentials.expressions.Expressionequal(char theChar)

        return equal(new Character(theChar));
    
public oracle.toplink.essentials.expressions.Expressionequal(double theValue)

        return equal(new Double(theValue));
    
public oracle.toplink.essentials.expressions.Expressionequal(float theValue)

        return equal(new Float(theValue));
    
public oracle.toplink.essentials.expressions.Expressionequal(int theValue)

        return equal(new Integer(theValue));
    
public oracle.toplink.essentials.expressions.Expressionequal(long theValue)

        return equal(new Long(theValue));
    
public oracle.toplink.essentials.expressions.Expressionequal(java.lang.Object theValue)
PUBLIC: Return an expression that compares if the receiver's value is equal to the other value. This is equivalent to the SQL "=" operator and Java "equals" method.

Example:

TopLink: employee.get("firstName").equal("Bob") Java: employee.getFirstName().equals("Bob") SQL: F_NAME = 'Bob'

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Equal);
        return anOperator.expressionFor(this, theValue);
    
public oracle.toplink.essentials.expressions.Expressionequal(oracle.toplink.essentials.expressions.Expression theValue)
Returns an expression that compares if the receiver's value is equal to the other value. This is equivalent to the SQL "=" operator and Java "equals" method.

Since OracleAS TopLink 10g (9.0.4) if this is an ExpressionBuilder and theValue is not used elsewhere, both will be translated to the same table. This can generate SQL with one less join for most exists subqueries.

Example:

TopLink: employee.get("manager").equal(employee) Java: employee.getManager().equals(employee) SQL (optimized): EMP_ID = MANAGER_ID SQL (unoptimized): t0.MANAGER_ID = t1.EMP_ID AND t0.EMP_ID = t1.EMP_ID

see
#equal(Object)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Equal);
        return anOperator.expressionFor(this, theValue);

    
public oracle.toplink.essentials.expressions.Expressionequal(short theValue)

        return equal(new Short(theValue));
    
public oracle.toplink.essentials.expressions.Expressionequal(boolean theBoolean)

        return equal(new Boolean(theBoolean));
    
public oracle.toplink.essentials.expressions.ExpressionequalOuterJoin(java.lang.Object theValue)
INTERNAL: Return an expression representing an outer join comparison

        ExpressionOperator anOperator = getOperator(ExpressionOperator.EqualOuterJoin);
        return anOperator.expressionFor(this, theValue);
    
public oracle.toplink.essentials.expressions.ExpressionequalOuterJoin(oracle.toplink.essentials.expressions.Expression theValue)
INTERNAL: Return an expression representing an outer join comparison

        ExpressionOperator anOperator = getOperator(ExpressionOperator.EqualOuterJoin);
        return anOperator.expressionFor(this, theValue);

    
public oracle.toplink.essentials.expressions.ExpressionequalsIgnoreCase(java.lang.String theValue)
PUBLIC: Return an expression that compares if the receiver's value is equal to the other value, ignoring case. This is equivalent to the Java "equalsIgnoreCase" method.

Example:

TopLink: employee.get("firstName").equalsIgnoreCase("Bob") Java: employee.getFirstName().equalsIgnoreCase("Bob") SQL: UPPER(F_NAME) = 'BOB'

        return toUpperCase().equal(theValue.toUpperCase());
    
public oracle.toplink.essentials.expressions.ExpressionequalsIgnoreCase(oracle.toplink.essentials.expressions.Expression theValue)
PUBLIC: Return an expression that compares if the receiver's value is equal to the other value, ignoring case. This is equivalent to the Java "equalsIgnoreCase" method.

Example:

TopLink: employee.get("firstName").equalsIgnoreCase("Bob") Java: employee.getFirstName().equalsIgnoreCase("Bob") SQL: UPPER(F_NAME) = 'BOB'

        return toUpperCase().equal(theValue.toUpperCase());
    
public oracle.toplink.essentials.expressions.Expressionexists(oracle.toplink.essentials.queryframework.ReportQuery subQuery)
PUBLIC: Return a sub query expression. A sub query using a report query to define a subselect within another queries expression or select's where clause. The sub query (the report query) will use its own expression builder be can reference expressions from the base expression builder.

Example:

ExpressionBuilder builder = new ExpressionBuilder(); ReportQuery subQuery = new ReportQuery(Employee.class, new ExpressionBuilder()); subQuery.setSelectionCriteria(subQuery.getExpressionBuilder().get("name").equal(builder.get("name"))); builder.exists(subQuery);

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Exists);
        return anOperator.expressionFor(subQuery(subQuery));
    
public oracle.toplink.essentials.expressions.ExpressionexistsNode(java.lang.String path)
PUBLIC: XMLType Function, gets the number of nodes returned by the given xpath expression returns 0 if there are none

param
- Xpath expression

        ExpressionOperator anOperator = getOperator(ExpressionOperator.ExistsNode);
        return anOperator.expressionFor(this, path);
    
public oracle.toplink.essentials.expressions.Expressionextract(java.lang.String path)
PUBLIC: XMLType Function, extracts a secton of XML from a larget XML document

param
String - xpath representing the node to be returned

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Extract);
        return anOperator.expressionFor(this, path);
    
public booleanextractPrimaryKeyValues(boolean requireExactMatch, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor, oracle.toplink.essentials.internal.sessions.AbstractRecord primaryKeyRow, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow)
INTERNAL: Extract the primary key from the expression into the row. Ensure that the query is quering the exact primary key. Return false if not on the primary key.

        return false;
    
public oracle.toplink.essentials.expressions.ExpressionextractValue(java.lang.String path)
PUBLIC: XMLType Function, extracts a value from an XMLType field

param
String - xpath expression

        ExpressionOperator anOperator = getOperator(ExpressionOperator.ExtractValue);
        return anOperator.expressionFor(this, path);
    
public static oracle.toplink.essentials.expressions.Expressionfrom(java.lang.Object value, oracle.toplink.essentials.expressions.Expression base)
INTERNAL: Create an expression node.

        //CR#... null value used to return null, must build a null constant expression.
        if (value instanceof Expression) {
            Expression exp = (Expression)value;
            if (exp.isValueExpression()) {
                exp.setLocalBase(base);
            } else {
                // We don't know which side of the relationship cares about the other one, so notify both
                // However for 3107049 value.equal(value) would cause infinite loop if did that.
                base.setLocalBase(exp);
            }
            return exp;
        }
        if (value instanceof ReportQuery) {
            Expression exp = base.subQuery((ReportQuery)value);
            exp.setLocalBase(base);// We don't know which side of the relationship cares about the other one, so notify both
            base.setLocalBase(exp);
            return exp;
        }
        return fromConstant(value, base);

    
public static oracle.toplink.essentials.expressions.ExpressionfromConstant(java.lang.Object value, oracle.toplink.essentials.expressions.Expression base)
INTERNAL: Create an expression node.

        return new ConstantExpression(value, base);
    
public static oracle.toplink.essentials.expressions.ExpressionfromLiteral(java.lang.String value, oracle.toplink.essentials.expressions.Expression base)
INTERNAL: Create an expression node.

        return new LiteralExpression(value, base);
    
public oracle.toplink.essentials.expressions.Expressionget(java.lang.String attributeName)
PUBLIC: Return an expression that wraps the attribute or query key name. This method is used to construct user-defined queries containing joins.

Example:

builder.get("address").get("city").equal("Ottawa");

        return get(attributeName, null);
    
public oracle.toplink.essentials.expressions.Expressionget(java.lang.String attributeName, java.util.Vector arguments)
INTERNAL:

        return null;
    
public oracle.toplink.essentials.expressions.ExpressiongetAllowingNull(java.lang.String attributeName)
ADVANCED: Return an expression that wraps the attribute or query key name. This is only applicable to 1:1 relationships, and allows the target of the relationship to be null if there is no correspondingn relationship in the database. Implemented via an outer join in the database.

Example:

builder.getAllowingNull("address").get("city").equal("Ottawa");

        return getAllowingNull(attributeName, null);
    
public oracle.toplink.essentials.expressions.ExpressiongetAllowingNull(java.lang.String attributeName, java.util.Vector arguments)
INTERNAL:


        /* this is meaningless for expressions in general */
        return get(attributeName, arguments);
    
public abstract oracle.toplink.essentials.expressions.ExpressionBuildergetBuilder()
INTERNAL: Return the expression builder which is the ultimate base of this expression, or null if there isn't one (shouldn't happen if we start from a root)

public oracle.toplink.essentials.internal.helper.DatabaseFieldgetClonedField()
INTERNAL: If there are any fields associated with this expression, return them

        return null;
    
public oracle.toplink.essentials.expressions.ExpressiongetField(java.lang.String fieldName)
ADVANCED: Return an expression representing a field in a data-level query. This is used internally in TopLink, or to construct queries involving fields and/or tables that are not mapped.

Example:

builder.getField("ADDR_ID").greaterThan(100); builder.getTable("PROJ_EMP").getField("TYPE").equal("S");

        throw QueryException.illegalUseOfGetField(fieldName);
    
public oracle.toplink.essentials.expressions.ExpressiongetField(oracle.toplink.essentials.internal.helper.DatabaseField field)
ADVANCED: Return an expression representing a field in a data-level query. This is used internally in TopLink, or to construct queries involving fields and/or tables that are not mapped.

Example:

builder.getField(aField).greaterThan(100);

        throw QueryException.illegalUseOfGetField(field);
    
public java.lang.ObjectgetFieldValue(java.lang.Object objectValue)
INTERNAL: Transform the object-level value into a database-level value

        return objectValue;

    
public java.util.VectorgetFields()
INTERNAL:

        return oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1);
    
public oracle.toplink.essentials.expressions.ExpressiongetFunction(int selector)
ADVANCED: This can be used for accessing user defined functions. The operator must be defined in ExpressionOperator to be able to reference it.

see
ExpressionOperator

Example:

builder.get("name").getFunction(MyFunctions.FOO_BAR).greaterThan(100);

        ExpressionOperator anOperator = getOperator(selector);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressiongetFunction(int selector, java.util.Vector arguments)
ADVANCED: This can be used for accessing user defined functions that have arguments. The operator must be defined in ExpressionOperator to be able to reference it.

see
ExpressionOperator

Example:

Vector arguments = new Vector(); arguments.addElement("blee"); builder.get("name").getFunction(MyFunctions.FOO_BAR, arguments).greaterThan(100);

        ExpressionOperator anOperator = getOperator(selector);
        return anOperator.expressionForArguments(this, arguments);
    
public oracle.toplink.essentials.expressions.ExpressiongetFunction(java.lang.String functionName)
ADVANCED: Return a user defined function accepting the argument. The function is assumed to be a normal prefix function and will print like, UPPER(base).

Example:

builder.get("firstName").getFunction("UPPER");

        ExpressionOperator anOperator = ExpressionOperator.simpleFunction(0, functionName);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressiongetFunction(java.lang.String functionName, java.lang.Object argument)
ADVANCED: Return a user defined function accepting the argument. The function is assumed to be a normal prefix function and will print like, CONCAT(base, argument).

        ExpressionOperator anOperator = ExpressionOperator.simpleTwoArgumentFunction(0, functionName);
        return anOperator.expressionFor(this, argument);
    
public oracle.toplink.essentials.expressions.ExpressiongetFunctionWithArguments(java.lang.String functionName, java.util.Vector arguments)
ADVANCED: Return a user defined function accepting all of the arguments. The function is assumed to be a normal prefix function like, CONCAT(base, value1, value2, value3, ...).

        ExpressionOperator anOperator = new ExpressionOperator();
        anOperator.setType(ExpressionOperator.FunctionOperator);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(arguments.size());
        v.addElement(functionName + "(");
        for (int index = 0; index < arguments.size(); index++) {
            v.addElement(", ");
        }
        v.addElement(")");
        anOperator.printsAs(v);
        anOperator.bePrefix();
        anOperator.setNodeClass(ClassConstants.FunctionExpression_Class);

        return anOperator.expressionForArguments(this, arguments);
    
public java.lang.StringgetName()
INTERNAL:

        return "";
    
public oracle.toplink.essentials.expressions.ExpressiongetNumberVal()
PUBLIC: XMLType Function - gets a number value from an XMLType

        ExpressionOperator anOperator = getOperator(ExpressionOperator.GetNumberVal);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressionOperatorgetOperator()
INTERNAL: Most expression have operators, so this is just a convenience method.

        return null;
    
public oracle.toplink.essentials.expressions.ExpressionOperatorgetOperator(int selector)
INTERNAL: Create a new expression tree with the named operator. Part of the implementation of user-level "get"

        ExpressionOperator result = ExpressionOperator.getOperator(new Integer(selector));
        if (result != null) {
            return result;
        }

        // Make a temporary operator which we expect the platform
        // to supply later.
        result = new ExpressionOperator();
        result.setSelector(selector);
        result.setNodeClass(ClassConstants.FunctionExpression_Class);
        return result;
    
public java.util.VectorgetOwnedTables()
INTERNAL: Return the tables that this node owns for purposes of table aliasing.

        return null;
    
public oracle.toplink.essentials.expressions.ExpressiongetParameter(java.lang.String parameterName, java.lang.Object type)
INTERNAL: Return an expression representing a parameter with the given name and type

        return new ParameterExpression(parameterName, this, type);

    
public oracle.toplink.essentials.expressions.ExpressiongetParameter(java.lang.String parameterName)
ADVANCED: Return an expression representing a parameter with the given name.

        return new ParameterExpression(parameterName, this, null);

    
public oracle.toplink.essentials.expressions.ExpressiongetParameter(oracle.toplink.essentials.internal.helper.DatabaseField field)
ADVANCED: Return an expression representing a parameter with the given name.

        return new ParameterExpression(field, this);

    
public oracle.toplink.essentials.internal.sessions.AbstractSessiongetSession()
INTERNAL:

        return getBuilder().getSession();
    
public oracle.toplink.essentials.expressions.ExpressiongetStringVal()
PUBLIC: XMLType Function - gets a string value from an XMLType

        ExpressionOperator anOperator = getOperator(ExpressionOperator.GetStringVal);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressiongetTable(java.lang.String tableName)
ADVANCED: Return an expression representing a table in a data-level query. This is used internally in TopLink, or to construct queries involving fields and/or tables that are not mapped.

Example:

builder.getTable("PROJ_EMP").getField("TYPE").equal("S");

        DatabaseTable table = new DatabaseTable(tableName);
        return getTable(table);
    
public oracle.toplink.essentials.expressions.ExpressiongetTable(oracle.toplink.essentials.internal.helper.DatabaseTable table)
ADVANCED: Return an expression representing a table in a data-level query. This is used internally in TopLink, or to construct queries involving fields and/or tables that are not mapped.

Example:

builder.getTable(linkTable).getField("TYPE").equal("S");

        throw QueryException.illegalUseOfGetTable(table);
    
public oracle.toplink.essentials.internal.expressions.TableAliasLookupgetTableAliases()
INTERNAL: Return the aliases used. By default, return null, since we don't have tables.

        return null;

    
public oracle.toplink.essentials.expressions.ExpressiongreaterThan(byte theValue)
PUBLIC: Return an expression that compares if the receivers value is equal to the other value. This is equivalent to the SQL "=" operator and Java "equals" method.

        return greaterThan(new Byte(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThan(char theChar)
PUBLIC: Return an expression that compares if the receivers value is equal to the other value. This is equivalent to the SQL "=" operator and Java "equals" method.

        return greaterThan(new Character(theChar));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThan(double theValue)
PUBLIC: Return an expression that compares if the receivers value is equal to the other value. This is equivalent to the SQL "=" operator and Java "equals" method.

        return greaterThan(new Double(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThan(float theValue)
PUBLIC: Return an expression that compares if the receivers value is equal to the other value. This is equivalent to the SQL "=" operator and Java "equals" method.

        return greaterThan(new Float(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThan(int theValue)
PUBLIC: Return an expression that compares if the receivers value is equal to the other value. This is equivalent to the SQL "=" operator and Java "equals" method.

        return greaterThan(new Integer(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThan(long theValue)
PUBLIC: Return an expression that compares if the receivers value is equal to the other value. This is equivalent to the SQL "=" operator and Java "equals" method.

        return greaterThan(new Long(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThan(java.lang.Object theValue)
PUBLIC: Return an expression that compares if the receiver's value is greater than the other value. This is equivalent to the SQL ">" operator.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.GreaterThan);
        return anOperator.expressionFor(this, theValue);
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThan(oracle.toplink.essentials.expressions.Expression theValue)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.GreaterThan);
        return anOperator.expressionFor(this, theValue);

    
public oracle.toplink.essentials.expressions.ExpressiongreaterThan(short theValue)
PUBLIC: Return an expression that compares if the receivers value is equal to the other value. This is equivalent to the SQL "=" operator and Java "equals" method.

        return greaterThan(new Short(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThan(boolean theBoolean)
PUBLIC: Return an expression that compares if the receivers value is equal to the other value. This is equivalent to the SQL "=" operator and Java "equals" method.

        return greaterThan(new Boolean(theBoolean));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThanEqual(byte theValue)
PUBLIC: Return an expression that compares if the receivers value is greater and equal to the other value. This is equivalent to the SQL ">=" operator .

        return greaterThanEqual(new Byte(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThanEqual(char theChar)
PUBLIC: Return an expression that compares if the receivers value is greater and equal to the other value. This is equivalent to the SQL ">=" operator .

        return greaterThanEqual(new Character(theChar));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThanEqual(double theValue)
PUBLIC: Return an expression that compares if the receivers value is greater and equal to the other value. This is equivalent to the SQL ">=" operator .

        return greaterThanEqual(new Double(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThanEqual(float theValue)
PUBLIC: Return an expression that compares if the receivers value is greater and equal to the other value. This is equivalent to the SQL ">=" operator .

        return greaterThanEqual(new Float(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThanEqual(int theValue)
PUBLIC: Return an expression that compares if the receivers value is greater and equal to the other value. This is equivalent to the SQL ">=" operator .

        return greaterThanEqual(new Integer(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThanEqual(long theValue)
PUBLIC: Return an expression that compares if the receivers value is greater and equal to the other value. This is equivalent to the SQL ">=" operator .

        return greaterThanEqual(new Long(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThanEqual(java.lang.Object theValue)
PUBLIC: Return an expression that compares if the receivers value is greater and equal to the other value. This is equivalent to the SQL ">=" operator .

        ExpressionOperator anOperator = getOperator(ExpressionOperator.GreaterThanEqual);
        return anOperator.expressionFor(this, theValue);

    
public oracle.toplink.essentials.expressions.ExpressiongreaterThanEqual(oracle.toplink.essentials.expressions.Expression theValue)
PUBLIC: Return an expression that compares if the receivers value is greater and equal to the other value. This is equivalent to the SQL ">=" operator .

        ExpressionOperator anOperator = getOperator(ExpressionOperator.GreaterThanEqual);
        return anOperator.expressionFor(this, theValue);

    
public oracle.toplink.essentials.expressions.ExpressiongreaterThanEqual(short theValue)
PUBLIC: Return an expression that compares if the receivers value is greater and equal to the other value. This is equivalent to the SQL ">=" operator .

        return greaterThanEqual(new Short(theValue));
    
public oracle.toplink.essentials.expressions.ExpressiongreaterThanEqual(boolean theBoolean)
PUBLIC: Return an expression that compares if the receivers value is greater and equal to the other value. This is equivalent to the SQL ">=" operator .

        return greaterThanEqual(new Boolean(theBoolean));
    
public booleanhasAsOfClause()
ADVANCED: Answers true if this is to be queried as of a past time.

return
false from asOf(null); hasAsOfClause().
see
#getAsOfClause

        return false;
    
public booleanhasBeenAliased()
INTERNAL: Answers if the database tables associated with this expression have been aliased. This insures the same tables are not aliased twice.

        return false;
    
public oracle.toplink.essentials.expressions.ExpressionhexToRaw()
PUBLIC: Function, returns binary array value for the hex string.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.HexToRaw);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressionifNull(java.lang.Object nullValue)
PUBLIC: Function return the a specific value if item returned from the query is null. Equivalent of the oracle NVL function

Example:

TopLink: employee.get("name").ifNull("no-name") Java: NA SQL: NVL(name, 'no-name')
*

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Nvl);
        return anOperator.expressionFor(this, nullValue);
    
public oracle.toplink.essentials.expressions.Expressionin(byte[] theBytes)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theBytes.length; index++) {
            vector.addElement(new Byte(theBytes[index]));
        }

        return in(vector);
    
public oracle.toplink.essentials.expressions.Expressionin(char[] theChars)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theChars.length; index++) {
            vector.addElement(new Character(theChars[index]));
        }

        return in(vector);
    
public oracle.toplink.essentials.expressions.Expressionin(double[] theDoubles)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theDoubles.length; index++) {
            vector.addElement(new Double(theDoubles[index]));
        }

        return in(vector);
    
public oracle.toplink.essentials.expressions.Expressionin(float[] theFloats)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theFloats.length; index++) {
            vector.addElement(new Float(theFloats[index]));
        }

        return in(vector);
    
public oracle.toplink.essentials.expressions.Expressionin(int[] theInts)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theInts.length; index++) {
            vector.addElement(new Integer(theInts[index]));
        }

        return in(vector);
    
public oracle.toplink.essentials.expressions.Expressionin(long[] theLongs)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theLongs.length; index++) {
            vector.addElement(new Long(theLongs[index]));
        }

        return in(vector);
    
public oracle.toplink.essentials.expressions.Expressionin(java.lang.Object[] theObjects)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theObjects.length; index++) {
            vector.addElement(theObjects[index]);
        }

        return in(vector);
    
public oracle.toplink.essentials.expressions.Expressionin(short[] theShorts)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theShorts.length; index++) {
            vector.addElement(new Short(theShorts[index]));
        }

        return in(vector);
    
public oracle.toplink.essentials.expressions.Expressionin(boolean[] theBooleans)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theBooleans.length; index++) {
            vector.addElement(new Boolean(theBooleans[index]));
        }

        return in(vector);
    
public oracle.toplink.essentials.expressions.Expressionin(java.util.Vector theObjects)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. The collection can be a collection of constants or expressions. This is equivalent to the SQL "IN" operator and Java "contains" operator.

Example:

TopLink: employee.get("age").in(agesVector) Java: agesVector.contains(employee.getAge()) SQL: AGE IN (55, 18, 30)

        //If none of the elements in theObjects is expression, build a ConstantExpression with theObjects.  
        if (!detectExpression(theObjects)) {
            return in(new ConstantExpression(theObjects, this));
        }
        //Otherwise build a collection of expressions.
        ExpressionOperator anOperator = getOperator(ExpressionOperator.In);
        return anOperator.expressionForArguments(this, theObjects);
    
public oracle.toplink.essentials.expressions.Expressionin(oracle.toplink.essentials.expressions.Expression arguments)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.In);
        return anOperator.expressionFor(this, arguments);
    
public oracle.toplink.essentials.expressions.Expressionin(oracle.toplink.essentials.queryframework.ReportQuery subQuery)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.InSubQuery);
        return anOperator.expressionFor(this, subQuery);
    
public oracle.toplink.essentials.expressions.ExpressionindexOf(java.lang.Object substring)
PUBLIC: Function, returns the integer index of the substring within the source string.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Instring);
        return anOperator.expressionFor(this, substring);
    
public booleanisCompoundExpression()
INTERNAL:

        return false;
    
public booleanisConstantExpression()
INTERNAL:

        return false;
    
public booleanisDataExpression()
INTERNAL:

        return false;
    
public oracle.toplink.essentials.expressions.ExpressionisEmpty(java.lang.String attributeName)
PUBLIC: A logical expression for the collection attributeName being empty. Equivalent to size(attributeName).equal(0)

Example:

TopLink: employee.isEmpty("phoneNumbers") Java: employee.getPhoneNumbers().size() == 0 SQL: SELECT ... FROM EMP t0 WHERE ( (SELECT COUNT(*) FROM PHONE t1 WHERE (t0.EMP_ID = t1.EMP_ID)) = 0)
This is a case where a fast operation in java does not translate to an equally fast operation in SQL, requiring a correlated subselect.

see
#size(java.lang.String)

        return size(attributeName).equal(0);
    
public booleanisExpressionBuilder()
INTERNAL:

        return false;
    
public booleanisFieldExpression()
INTERNAL:

        return false;
    
public oracle.toplink.essentials.expressions.ExpressionisFragment()
PUBLIC: XMLType Function - evaluates to 0 if the xml is a well formed document and 1 if the document is a fragment

        ExpressionOperator anOperator = getOperator(ExpressionOperator.IsFragment);
        return anOperator.expressionFor(this);
    
public booleanisFunctionExpression()
INTERNAL:

        return false;
    
public booleanisLiteralExpression()
INTERNAL:

        return false;
    
public booleanisLogicalExpression()
INTERNAL:

        return false;
    
public oracle.toplink.essentials.expressions.ExpressionisNull()
PUBLIC: Compare to null.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.IsNull);
        return anOperator.expressionFor(this);
    
public booleanisObjectExpression()
INTERNAL:

        return false;
    
public booleanisParameterExpression()
INTERNAL:

        return false;
    
public booleanisQueryKeyExpression()
INTERNAL:

        return false;
    
public booleanisRelationExpression()
INTERNAL:

        return false;
    
public booleanisTableExpression()
INTERNAL:

        return false;
    
public booleanisValueExpression()
INTERNAL: Subclasses implement (isParameterExpression() || isConstantExpression())

        return false;
    
public voiditerateOn(oracle.toplink.essentials.internal.expressions.ExpressionIterator iterator)
INTERNAL: For iterating using an inner class

        iterator.iterate(this);
    
public oracle.toplink.essentials.expressions.ExpressionlastDay()
PUBLIC: Function, returns the date with the last date in the months of this source date.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.LastDay);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressionleftPad(int size, java.lang.Object substring)
PUBLIC: Function, returns the string padded with the substring to the size.

        return leftPad(new Integer(size), substring);
    
public oracle.toplink.essentials.expressions.ExpressionleftPad(java.lang.Object size, java.lang.Object substring)
PUBLIC: Function, returns the string padded with the substring to the size.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.LeftPad);
        Vector args = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        args.addElement(size);
        args.addElement(substring);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.ExpressionleftTrim()
PUBLIC: Function, returns the string left trimmed for white space.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.LeftTrim);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressionleftTrim(java.lang.Object substring)
PUBLIC: Function, returns the string with the substring trimed from the left.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.LeftTrim2);
        return anOperator.expressionFor(this, substring);
    
public oracle.toplink.essentials.expressions.Expressionlength()
PUBLIC: Function, returns the size of the string.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Length);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressionlessThan(byte theValue)
PUBLIC: Return an expression that compares if the receivers value is less than the other value. This is equivalent to the SQL "<" operator.

        return lessThan(new Byte(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThan(char theChar)
PUBLIC: Return an expression that compares if the receivers value is less than the other value. This is equivalent to the SQL "<" operator.

        return lessThan(new Character(theChar));
    
public oracle.toplink.essentials.expressions.ExpressionlessThan(double theValue)
PUBLIC: Return an expression that compares if the receivers value is less than the other value. This is equivalent to the SQL "<" operator.

        return lessThan(new Double(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThan(float theValue)
PUBLIC: Return an expression that compares if the receivers value is less than the other value. This is equivalent to the SQL "<" operator.

        return lessThan(new Float(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThan(int theValue)
PUBLIC: Return an expression that compares if the receivers value is less than the other value. This is equivalent to the SQL "<" operator.

        return lessThan(new Integer(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThan(long theValue)
PUBLIC: Return an expression that compares if the receivers value is less than the other value. This is equivalent to the SQL "<" operator.

        return lessThan(new Long(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThan(java.lang.Object theValue)
PUBLIC: Return an expression that compares if the receivers value is less than the other value. This is equivalent to the SQL "<" operator.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.LessThan);
        return anOperator.expressionFor(this, theValue);
    
public oracle.toplink.essentials.expressions.ExpressionlessThan(oracle.toplink.essentials.expressions.Expression theValue)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.LessThan);
        return anOperator.expressionFor(this, theValue);

    
public oracle.toplink.essentials.expressions.ExpressionlessThan(short theValue)
PUBLIC: Return an expression that compares if the receivers value is less than the other value. This is equivalent to the SQL "<" operator.

        return lessThan(new Short(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThan(boolean theBoolean)
PUBLIC: Return an expression that compares if the receivers value is less than the other value. This is equivalent to the SQL "<" operator.

        return lessThan(new Boolean(theBoolean));
    
public oracle.toplink.essentials.expressions.ExpressionlessThanEqual(byte theValue)
PUBLIC: Return an expression that compares if the receivers value is less than and equal to the other value. This is equivalent to the SQL "<=" operator.

        return lessThanEqual(new Byte(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThanEqual(char theChar)
PUBLIC: Return an expression that compares if the receivers value is less than and equal to the other value. This is equivalent to the SQL "<=" operator.

        return lessThanEqual(new Character(theChar));
    
public oracle.toplink.essentials.expressions.ExpressionlessThanEqual(double theValue)
PUBLIC: Return an expression that compares if the receivers value is less than and equal to the other value. This is equivalent to the SQL "<=" operator.

        return lessThanEqual(new Double(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThanEqual(float theValue)
PUBLIC: Return an expression that compares if the receivers value is less than and equal to the other value. This is equivalent to the SQL "<=" operator.

        return lessThanEqual(new Float(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThanEqual(int theValue)
PUBLIC: Return an expression that compares if the receivers value is less than and equal to the other value. This is equivalent to the SQL "<=" operator.

        return lessThanEqual(new Integer(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThanEqual(long theValue)
PUBLIC: Return an expression that compares if the receivers value is less than and equal to the other value. This is equivalent to the SQL "<=" operator.

        return lessThanEqual(new Long(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThanEqual(java.lang.Object theValue)
PUBLIC: Return an expression that compares if the receivers value is less than and equal to the other value. This is equivalent to the SQL "<=" operator.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.LessThanEqual);
        return anOperator.expressionFor(this, theValue);
    
public oracle.toplink.essentials.expressions.ExpressionlessThanEqual(oracle.toplink.essentials.expressions.Expression theValue)
PUBLIC: Return an expression that compares if the receivers value is less than and equal to the other value. This is equivalent to the SQL "<=" operator.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.LessThanEqual);
        return anOperator.expressionFor(this, theValue);

    
public oracle.toplink.essentials.expressions.ExpressionlessThanEqual(short theValue)
PUBLIC: Return an expression that compares if the receivers value is less than and equal to the other value. This is equivalent to the SQL "<=" operator.

        return lessThanEqual(new Short(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionlessThanEqual(boolean theBoolean)
PUBLIC: Return an expression that compares if the receivers value is less than and equal to the other value. This is equivalent to the SQL "<=" operator.

        return lessThanEqual(new Boolean(theBoolean));
    
public oracle.toplink.essentials.expressions.Expressionlike(java.lang.String value)
PUBLIC: Return an expression that compares if the receivers value is like other value. This is equivalent to the SQL "LIKE" operator that except wildcards. The character "%" means any sequence of characters and the character "_" mean any character. i.e. "B%" == "Bob", "B_B" == "BOB"

Example:

TopLink: employee.get("firstName").like("B%") Java: NA SQL: F_NAME LIKE 'B%'

        return like(new ConstantExpression(value, this));
    
public oracle.toplink.essentials.expressions.Expressionlike(java.lang.String value, java.lang.String escapeSequence)
PUBLIC: Return an expression that compares if the receivers value is like other value. This is equivalent to the SQL "LIKE ESCAPE" operator that except wildcards. The character "%" means any sequence of characters and the character "_" mean any character. i.e. "B%" == "Bob", "B_B" == "BOB" The escape sequence specifies a set of characters the may be used to indicate that an one of the wildcard characters should be interpretted literally.

Example:

TopLink: employee.get("firstName").like("B\_SMITH", "\") Java: NA SQL: F_NAME LIKE 'B\_SMITH ESCAPE '\''

        ExpressionOperator anOperator = getOperator(ExpressionOperator.LikeEscape);
        Vector args = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        args.addElement(value);
        args.addElement(escapeSequence);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.Expressionlike(oracle.toplink.essentials.expressions.Expression argument)
PUBLIC: Return an expression that compares if the receivers value is like other value. This is equivalent to the SQL "LIKE" operator that except wildcards. The character "%" means any sequence of characters and the character "_" mean any character. i.e. "B%" == "Bob", "B_B" == "BOB"

Example:

TopLink: employee.get("firstName").like("B%") Java: NA SQL: F_NAME LIKE 'B%'

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Like);
        return anOperator.expressionFor(this, argument);
    
public oracle.toplink.essentials.expressions.Expressionlike(oracle.toplink.essentials.expressions.Expression value, oracle.toplink.essentials.expressions.Expression escapeSequence)
PUBLIC: Return an expression that compares if the receivers value is like other value. This is equivalent to the SQL "LIKE ESCAPE" operator that except wildcards. The character "%" means any sequence of characters and the character "_" mean any character. i.e. "B%" == "Bob", "B_B" == "BOB" The escape sequence specifies a set of characters the may be used to indicate that an one of the wildcard characters should be interpretted literally.

Example:

TopLink: employee.get("firstName").like("B\_SMITH", "\") Java: NA SQL: F_NAME LIKE 'B\_SMITH ESCAPE '\''

        ExpressionOperator anOperator = getOperator(ExpressionOperator.LikeEscape);
        Vector args = new Vector();
        args.addElement(value);
        args.addElement(escapeSequence);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.ExpressionlikeIgnoreCase(java.lang.String theValue)
PUBLIC: Return an expression that compares if the receivers value is like the other value, ignoring case. This is a case in-sensitive like.

Example:

TopLink: employee.get("firstName").likeIgnoreCase("%Bob%") Java: none SQL: UPPER(F_NAME) LIKE '%BOB%'

        return toUpperCase().like(theValue.toUpperCase());
    
public oracle.toplink.essentials.expressions.ExpressionlikeIgnoreCase(oracle.toplink.essentials.expressions.Expression theValue)
PUBLIC: Return an expression that compares if the receivers value is like the other value, ignoring case. This is a case in-sensitive like.

        return toUpperCase().like(theValue.toUpperCase());
    
public oracle.toplink.essentials.expressions.Expressionliteral(java.lang.String literal)
ADVANCED: Return an expression on the literal. A literal is a specific SQL syntax string that will be printed as is without quotes in the SQL. It can be useful for printing database key words or global variables.

Example:

reportQuery.addItem("currentTime", builder.literal("SYSDATE"));

        return new LiteralExpression(literal, this);
    
public oracle.toplink.essentials.expressions.Expressionlocate(java.lang.Object str)
PUBLIC: Function, returns the position of str in this

Example:

TopLink: employee.get("firstName").locate("ob") Java: employee.getFirstName().indexOf("ob") + 1 SQL: LOCATE('ob', t0.F_NAME)

Note that while in String.locate(str) -1 is returned if not found, and the index starting at 0 if found, in SQL it is 0 if not found, and the index starting at 1 if found.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Locate);
        Vector args = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1);
        args.addElement(str);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.Expressionlocate(java.lang.String str, int fromIndex)
PUBLIC: Function, returns the position of str in this, starting the search at fromIndex.

Example:

TopLink: employee.get("firstName").locate("ob", 1) Java: employee.getFirstName().indexOf("ob", 1) + 1 SQL: LOCATE('ob', t0.F_NAME, 1)

Note that while in String.locate(str) -1 is returned if not found, and the index starting at 0 if found, in SQL it is 0 if not found, and the index starting at 1 if found.

        return locate(str, new Integer(fromIndex));
    
public oracle.toplink.essentials.expressions.Expressionlocate(java.lang.Object str, java.lang.Object fromIndex)
PUBLIC: Function, returns the position of str in this, starting the search at fromIndex.

Example:

TopLink: employee.get("firstName").locate("ob", 1) Java: employee.getFirstName().indexOf("ob", 1) + 1 SQL: LOCATE('ob', t0.F_NAME, 1)

Note that while in String.locate(str) -1 is returned if not found, and the index starting at 0 if found, in SQL it is 0 if not found, and the index starting at 1 if found.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Locate2);
        Vector args = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        args.addElement(str);
        args.addElement(fromIndex);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.Expressionmaximum()
PUBLIC: This represents the aggregate function Maximum. Can be used only within Report Queries.

        return getFunction(ExpressionOperator.Maximum);
    
public oracle.toplink.essentials.expressions.Expressionminimum()
PUBLIC: This represents the aggregate function Minimum. Can be used only within Report Queries.

        return getFunction(ExpressionOperator.Minimum);
    
public oracle.toplink.essentials.expressions.ExpressionmonthsBetween(java.lang.Object otherDate)
PUBLIC: Function, returns the decimal number of months between the two dates.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.MonthsBetween);
        return anOperator.expressionFor(this, otherDate);
    
public oracle.toplink.essentials.expressions.ExpressionnewTime(java.lang.String timeZoneFrom, java.lang.String timeZoneTo)
PUBLIC: funcation return a date converted to a new timezone. Equivalent of the Oracle NEW_TIME function

Example:

TopLink: employee.get("date").newTime("EST", "PST") Java: NA SQL: NEW_TIME(date, 'EST', 'PST')
*

        ExpressionOperator anOperator = getOperator(ExpressionOperator.NewTime);
        Vector args = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
        args.addElement(timeZoneFrom);
        args.addElement(timeZoneTo);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.ExpressionnextDay(java.lang.Object dayName)
PUBLIC: Function, returns the date with the next day from the source date as the day name given.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.NextDay);
        return anOperator.expressionFor(this, dayName);
    
public oracle.toplink.essentials.expressions.ExpressionnoneOf(java.lang.String attributeName, oracle.toplink.essentials.expressions.Expression criteria)
PUBLIC: Returns an expression equivalent to none of attributeName holding true for criteria.

For every expression with an anyOf, its negation has either an allOf or a noneOf. The following two examples will illustrate as the second is the negation of the first:

AnyOf Example: Employees with a '613' area code phone number.

ReadAllQuery query = new ReadAllQuery(Employee.class); ExpressionBuilder employee = new ExpressionBuilder(); Expression exp = employee.anyOf("phoneNumbers").get("areaCode").equal("613");

NoneOf Example: Employees with no '613' area code phone numbers.

ExpressionBuilder employee = new ExpressionBuilder(); ExpressionBuilder phones = new ExpressionBuilder(); Expression exp = employee.noneOf("phoneNumbers", phones.get("areaCode").equal("613")); SQL: SELECT ... EMPLOYEE t0 WHERE NOT EXISTS (SELECT ... PHONE t1 WHERE (t0.EMP_ID = t1.EMP_ID) AND (t1.AREACODE = '613'))

noneOf is the universal counterpart to the existential anyOf. To have the condition evaluated for each instance it must be put inside of a subquery, which can be expressed as not exists (any of attributeName some condition). (All x such that !y = !Exist x such that y).

Likewise the syntax employee.noneOf("phoneNumbers").get("areaCode").equal("613") is not supported for the equal must go inside a subQuery.

This method saves you from writing the sub query yourself. The above is equivalent to the following expression:

ExpressionBuilder employee = new ExpressionBuilder(); ExpressionBuilder phone = new ExpressionBuilder(); ReportQuery subQuery = new ReportQuery(Phone.class, phone); subQuery.retreivePrimaryKeys(); subQuery.setSelectionCriteria(phone.equal(employee.anyOf("phoneNumbers").and( phone.get("areaCode").equal("613"))); Expression exp = employee.notExists(subQuery);

param
criteria must have its own builder, as it will become the seperate selection criteria of a subQuery.
return
a notExists subQuery expression

        ReportQuery subQuery = new ReportQuery();
        subQuery.setShouldRetrieveFirstPrimaryKey(true);
        Expression builder = criteria.getBuilder();
        criteria = builder.equal(anyOf(attributeName)).and(criteria);
        subQuery.setSelectionCriteria(criteria);
        return notExists(subQuery);
    
public oracle.toplink.essentials.expressions.Expressionnormalize(oracle.toplink.essentials.internal.expressions.ExpressionNormalizer normalizer)
INTERNAL: Normalize into a structure that is printable. Also compute printing information such as outer joins.

        //This class has no validation but we should still make the method call for consistency
        //bug # 2956674
        //validation is moved into normalize to ensure that expressions are valid before we attempt to work with them
        validateNode();
        return this;
    
public oracle.toplink.essentials.expressions.Expressionnot()
PUBLIC: Return an expression that is the boolean logical negation of the expression. This is equivalent to the SQL "NOT" operator and the Java "!" operator.

Example:

TopLink: employee.get("age").equal(24).not() Java: (! (employee.getAge() == 24)) SQL: NOT (AGE = 24)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Not);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressionnotBetween(byte leftValue, byte rightValue)
PUBLIC: Return an expression that compares if the receivers value is not between two other values. Equivalent to between negated.

see
#between(Object, Object)

        return notBetween(new Byte(leftValue), new Byte(rightValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotBetween(char leftChar, char rightChar)
PUBLIC: Return an expression that compares if the receivers value is not between two other values. Equivalent to between negated.

see
#between(Object, Object)

        return notBetween(new Character(leftChar), new Character(rightChar));
    
public oracle.toplink.essentials.expressions.ExpressionnotBetween(double leftValue, double rightValue)
PUBLIC: Return an expression that compares if the receivers value is not between two other values. Equivalent to between negated.

see
#between(Object, Object)

        return notBetween(new Double(leftValue), new Double(rightValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotBetween(float leftValue, float rightValue)
PUBLIC: Return an expression that compares if the receivers value is not between two other values. Equivalent to between negated.

see
#between(Object, Object)

        return notBetween(new Float(leftValue), new Float(rightValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotBetween(int leftValue, int rightValue)
PUBLIC: Return an expression that compares if the receivers value is not between two other values. Equivalent to between negated.

see
#between(Object, Object)

        return notBetween(new Integer(leftValue), new Integer(rightValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotBetween(long leftValue, long rightValue)
PUBLIC: Return an expression that compares if the receivers value is not between two other values. Equivalent to between negated.

see
#between(Object, Object)

        return notBetween(new Long(leftValue), new Long(rightValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotBetween(java.lang.Object leftValue, java.lang.Object rightValue)
PUBLIC: Return an expression that compares if the receivers value is not between two other values. Equivalent to between negated.

see
#between(Object, Object)

        return between(leftValue, rightValue).not();
    
public oracle.toplink.essentials.expressions.ExpressionnotBetween(oracle.toplink.essentials.expressions.Expression leftExpression, oracle.toplink.essentials.expressions.Expression rightExpression)
PUBLIC: Return an expression that compares if the receivers value is not between two other values. Equivalent to between negated.

see
#between(Object, Object)

        return between(leftExpression, rightExpression).not();
    
public oracle.toplink.essentials.expressions.ExpressionnotBetween(short leftValue, short rightValue)
PUBLIC: Return an expression that compares if the receivers value is not between two other values. Equivalent to between negated.

see
#between(Object, Object)

        return notBetween(new Short(leftValue), new Short(rightValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotEmpty(java.lang.String attributeName)
PUBLIC: A logical expression for the collection attributeName not being empty. Equivalent to size(attributeName).greaterThan(0)

Example:

TopLink: employee.notEmpty("phoneNumbers") Java: employee.getPhoneNumbers().size() > 0 SQL: SELECT ... FROM EMP t0 WHERE ( (SELECT COUNT(*) FROM PHONE t1 WHERE (t0.EMP_ID = t1.EMP_ID)) > 0)
This is a case where a fast operation in java does not translate to an equally fast operation in SQL, requiring a correlated subselect.

see
#size(java.lang.String)

        return size(attributeName).greaterThan(0);
    
public oracle.toplink.essentials.expressions.ExpressionnotEqual(byte theValue)
PUBLIC: Return an expression that compares if the receivers value is not equal to the other value. This is equivalent to the SQL "<>" operator

see
#equal(Object)

        return notEqual(new Byte(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotEqual(char theChar)
PUBLIC: Return an expression that compares if the receivers value is not equal to the other value. This is equivalent to the SQL "<>" operator

see
#equal(Object)

        return notEqual(new Character(theChar));
    
public oracle.toplink.essentials.expressions.ExpressionnotEqual(double theValue)
PUBLIC: Return an expression that compares if the receivers value is not equal to the other value. This is equivalent to the SQL "<>" operator

see
#equal(Object)

        return notEqual(new Double(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotEqual(float theValue)
PUBLIC: Return an expression that compares if the receivers value is not equal to the other value. This is equivalent to the SQL "<>" operator

see
#equal(Object)

        return notEqual(new Float(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotEqual(int theValue)
PUBLIC: Return an expression that compares if the receivers value is not equal to the other value. This is equivalent to the SQL "<>" operator

see
#equal(Object)

        return notEqual(new Integer(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotEqual(long theValue)
PUBLIC: Return an expression that compares if the receivers value is not equal to the other value. This is equivalent to the SQL "<>" operator

see
#equal(Object)

        return notEqual(new Long(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotEqual(java.lang.Object theValue)
PUBLIC: Return an expression that compares if the receivers value is not equal to the other value. This is equivalent to the SQL "<>" operator

see
#equal(Object)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.NotEqual);
        return anOperator.expressionFor(this, theValue);
    
public oracle.toplink.essentials.expressions.ExpressionnotEqual(oracle.toplink.essentials.expressions.Expression theValue)
PUBLIC: Return an expression that compares if the receivers value is not equal to the other value. This is equivalent to the SQL "<>" operator

see
#equal(Object)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.NotEqual);
        return anOperator.expressionFor(this, theValue);
    
public oracle.toplink.essentials.expressions.ExpressionnotEqual(short theValue)
PUBLIC: Return an expression that compares if the receivers value is not equal to the other value. This is equivalent to the SQL "<>" operator

see
#equal(Object)

        return notEqual(new Short(theValue));
    
public oracle.toplink.essentials.expressions.ExpressionnotEqual(boolean theBoolean)
PUBLIC: Return an expression that compares if the receivers value is not equal to the other value. This is equivalent to the SQL "<>" operator

see
#equal(Object)

        return notEqual(new Boolean(theBoolean));
    
public oracle.toplink.essentials.expressions.ExpressionnotExists(oracle.toplink.essentials.queryframework.ReportQuery subQuery)
PUBLIC: Return a sub query expression. A sub query using a report query to define a subselect within another queries expression or select's where clause. The sub query (the report query) will use its own expression builder be can reference expressions from the base expression builder.

Example:

ExpressionBuilder builder = new ExpressionBuilder(); ReportQuery subQuery = new ReportQuery(Employee.class, new ExpressionBuilder()); subQuery.setSelectionCriteria(subQuery.getExpressionBuilder().get("name").equal(builder.get("name"))); builder.notExists(subQuery);

        ExpressionOperator anOperator = getOperator(ExpressionOperator.NotExists);
        return anOperator.expressionFor(subQuery(subQuery));
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(byte[] theBytes)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theBytes.length; index++) {
            vector.addElement(new Byte(theBytes[index]));
        }

        return notIn(vector);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(char[] theChars)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theChars.length; index++) {
            vector.addElement(new Character(theChars[index]));
        }

        return notIn(vector);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(double[] theDoubles)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theDoubles.length; index++) {
            vector.addElement(new Double(theDoubles[index]));
        }

        return notIn(vector);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(float[] theFloats)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theFloats.length; index++) {
            vector.addElement(new Float(theFloats[index]));
        }

        return notIn(vector);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(int[] theInts)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theInts.length; index++) {
            vector.addElement(new Integer(theInts[index]));
        }

        return notIn(vector);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(long[] theLongs)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theLongs.length; index++) {
            vector.addElement(new Long(theLongs[index]));
        }

        return notIn(vector);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(java.lang.Object[] theObjects)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theObjects.length; index++) {
            vector.addElement(theObjects[index]);
        }

        return notIn(vector);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(oracle.toplink.essentials.queryframework.ReportQuery subQuery)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.NotInSubQuery);
        return anOperator.expressionFor(this, subQuery);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(short[] theShorts)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theShorts.length; index++) {
            vector.addElement(new Short(theShorts[index]));
        }

        return notIn(vector);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(boolean[] theBooleans)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theBooleans.length; index++) {
            vector.addElement(new Boolean(theBooleans[index]));
        }

        return notIn(vector);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(java.util.Vector theObjects)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. The collection can be a collection of constants or expressions. This is equivalent to the SQL "IN" operator and Java "contains" operator.

Example:

TopLink: employee.get("age").in(agesVector) Java: agesVector.contains(employee.getAge()) SQL: AGE IN (55, 18, 30)

        //If none of the elements in theObjects is expression, build a ConstantExpression with theObjects.  
        if (!detectExpression(theObjects)) {
            return notIn(new ConstantExpression(theObjects, this));
        }
        //Otherwise build a collection of expressions.
        ExpressionOperator anOperator = getOperator(ExpressionOperator.NotIn);
        return anOperator.expressionForArguments(this, theObjects);
    
public oracle.toplink.essentials.expressions.ExpressionnotIn(oracle.toplink.essentials.expressions.Expression arguments)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.NotIn);
        return anOperator.expressionFor(this, arguments);
    
public oracle.toplink.essentials.expressions.ExpressionnotLike(java.lang.String aString)
PUBLIC: Return an expression that compares if the receivers value is not like the other value. Equivalent to like negated.

see
#like(String)

        return notLike(new ConstantExpression(aString, this));
    
public oracle.toplink.essentials.expressions.ExpressionnotLike(oracle.toplink.essentials.expressions.Expression arguments)
PUBLIC: Return an expression that compares if the receivers value is not like the other value. Equivalent to like negated.

see
#like(String)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.NotLike);
        return anOperator.expressionFor(this, arguments);
    
public oracle.toplink.essentials.expressions.ExpressionnotNull()
PUBLIC: Return an expression representing a comparison to null

Example:

TopLink: employee.get("age").notNull() Java: employee.getAge() != null SQL: AGE IS NOT NULL

        ExpressionOperator anOperator = getOperator(ExpressionOperator.NotNull);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.Expressionor(oracle.toplink.essentials.expressions.Expression theExpression)
PUBLIC: Return an expression that is the boolean logical combination of both expressions. This is equivalent to the SQL "OR" operator and the Java "||" operator.

Example:

TopLink: employee.get("firstName").equal("Bob").OR(employee.get("lastName").equal("Smith")) Java: (employee.getFirstName().equals("Bob")) || (employee.getLastName().equals("Smith")) SQL: F_NAME = 'Bob' OR L_NAME = 'Smith'

        // Allow ands with null.
        if (theExpression == null) {
            return this;
        }

        ExpressionBuilder base = getBuilder();
        Expression expressionToUse = theExpression;

        // Ensure the same builder, unless a parralel query is used.
        if ((theExpression.getBuilder() != base) && (theExpression.getBuilder().getQueryClass() == null)) {
            expressionToUse = theExpression.rebuildOn(base);
        }

        if (base == this) {// Allow and to be sent to the builder.
            return expressionToUse;
        }

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Or);
        return anOperator.expressionFor(this, expressionToUse);
    
public oracle.toplink.essentials.expressions.ExpressionperformOperator(oracle.toplink.essentials.expressions.ExpressionOperator anOperator, java.util.Vector args)
INTERNAL:

        return anOperator.expressionForArguments(this, args);
    
protected voidpostCopyIn(java.util.Dictionary alreadyDone)

    
public oracle.toplink.essentials.expressions.ExpressionpostfixSQL(java.lang.String sqlString)
ADVANCED: Inserts the SQL as is directly into the expression. The sql will be printed immediately after (postfixed to) the sql for this.

        ExpressionOperator anOperator = new ExpressionOperator();
        anOperator.setType(ExpressionOperator.FunctionOperator);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1);
        v.addElement(sqlString);
        anOperator.printsAs(v);
        anOperator.bePostfix();
        anOperator.setNodeClass(ClassConstants.FunctionExpression_Class);

        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressionprefixSQL(java.lang.String sqlString)
ADVANCED: Insert the SQL as is directly into the expression. The sql will be printed immediately before (prefixed to) the sql for this.

        ExpressionOperator anOperator = new ExpressionOperator();
        anOperator.setType(ExpressionOperator.FunctionOperator);
        Vector v = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1);
        v.addElement(sqlString);
        anOperator.printsAs(v);
        anOperator.bePrefix();
        anOperator.setNodeClass(ClassConstants.FunctionExpression_Class);

        return anOperator.expressionFor(this);
    
public voidprintJava(oracle.toplink.essentials.internal.expressions.ExpressionJavaPrinter printer)
INTERNAL: Print java for project class generation

        //do nothing
    
public abstract voidprintSQL(oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer)
INTERNAL: Print SQL

public voidprintSQLWithoutConversion(oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer)
INTERNAL: Print SQL, this is called from functions, so must not be converted through the mapping.

        printSQL(printer);
    
public abstract oracle.toplink.essentials.expressions.ExpressionrebuildOn(oracle.toplink.essentials.expressions.Expression newBase)
INTERNAL: This expression is built on a different base than the one we want. Rebuild it and return the root of the new tree If receiver is a complex expression, use cloneUsing(newBase) instead.

see
#cloneUsing(Expression newBase)

public oracle.toplink.essentials.expressions.Expressionref()
ADVANCED: For Object-relational support.

        return getFunction(ExpressionOperator.Ref);
    
protected oracle.toplink.essentials.expressions.ExpressionregisterIn(java.util.Dictionary alreadyDone)

        Expression copy = (Expression)shallowClone();
        alreadyDone.put(this, copy);
        copy.postCopyIn(alreadyDone);
        return copy;

    
public oracle.toplink.essentials.expressions.Expressionreplace(java.lang.Object stringToReplace, java.lang.Object stringToReplaceWith)
PUBLIC: Function, returns the string with occurances of the first substring replaced with the second substring.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Replace);
        Vector args = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        args.addElement(stringToReplace);
        args.addElement(stringToReplaceWith);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.Expressionreplicate(int constant)
PUBLIC: return the result of this query repeated a given number of times. Equivalent of the Sybase REPLICATE function

Example:

TopLink: employee.get("name").replicate(2) Java: NA SQL: REPLICATE(name, 2)

        return replicate(new Integer(constant));
    
public oracle.toplink.essentials.expressions.Expressionreplicate(java.lang.Object theValue)
PUBLIC: return the result of this query repeated a given number of times. Equivalent of the Sybase REPLICATE function

Example:

TopLink: employee.get("name").replicate(2) Java: NA SQL: REPLICATE(name, 2)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Replicate);
        return anOperator.expressionFor(this, theValue);
    
protected voidresetCache()
Reset cached information here so that we can be sure we're accurate.

    
public oracle.toplink.essentials.expressions.Expressionreverse()
PUBLIC: Function return the reverse of the query result. Equivalent of the Sybase REVERSE function

Example:

TopLink: employee.get("name").reverse() Java: NA SQL: REVERSE(name)

        return getFunction(ExpressionOperator.Reverse);
    
public oracle.toplink.essentials.expressions.Expressionright(int characters)
PUBLIC: Function return a given number of characters starting at the right of a string. Equivalent to the Sybase RIGHT function

Example:

TopLink: employee.get("name").right(2) Java: NA SQL: RIGHT(name, 2)

        return right(new Integer(characters));
    
public oracle.toplink.essentials.expressions.Expressionright(java.lang.Object characters)
PUBLIC: Function return a given number of characters starting at the right of a string. Equivalent to the Sybase RIGHT function

Example:

TopLink: employee.get("name").right(2) Java: NA SQL: RIGHT(name, 2)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Right);
        return anOperator.expressionFor(this, characters);
    
public oracle.toplink.essentials.expressions.ExpressionrightPad(int size, java.lang.Object substring)
PUBLIC: Function, returns the string padded with the substring to the size.

        return rightPad(new Integer(size), substring);
    
public oracle.toplink.essentials.expressions.ExpressionrightPad(java.lang.Object size, java.lang.Object substring)
PUBLIC: Function, returns the string padded with the substring to the size.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.RightPad);
        Vector args = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        args.addElement(size);
        args.addElement(substring);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.ExpressionrightTrim()
PUBLIC: Function, returns the string right trimmed for white space.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.RightTrim);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressionrightTrim(java.lang.Object substring)
PUBLIC: Function, returns the string with the substring trimed from the right.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.RightTrim2);
        return anOperator.expressionFor(this, substring);
    
public oracle.toplink.essentials.expressions.ExpressionroundDate(java.lang.Object yearOrMonthOrDayRoundToken)
PUBLIC: Function, returns the date rounded to the year, month or day.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.RoundDate);
        return anOperator.expressionFor(this, yearOrMonthOrDayRoundToken);
    
public booleanselectIfOrderedBy()
PUBLIC: Return whether this expression should be included in the SELECT clause if it is used in an ORDER BY clause

        return selectIfOrderedBy;
    
public voidsetLocalBase(oracle.toplink.essentials.expressions.Expression exp)
INTERNAL: Set the local base expression, ie the one on the other side of the operator Most types will ignore this, since they don't need it.

    
public voidsetSelectIfOrderedBy(boolean selectIfOrderedBy)
PUBLIC: Set whether this expression should be included in the SELECT clause of a query that uses it in the ORDER BY clause.

param
selectIfOrderedBy

        this.selectIfOrderedBy = selectIfOrderedBy;
    
public oracle.toplink.essentials.expressions.ExpressionshallowClone()
INTERNAL:

        Expression result = null;
        try {
            result = (Expression)super.clone();
        } catch (CloneNotSupportedException e) {
        }
        ;
        return result;
    
public oracle.toplink.essentials.expressions.Expressionsize(java.lang.String attributeName)
PUBLIC: A logical expression for the size of collection attributeName.

Example:

TopLink: employee.size("phoneNumbers") Java: employee.getPhoneNumbers().size() SQL: SELECT ... FROM EMP t0 WHERE ... (SELECT COUNT(*) FROM PHONE t1 WHERE (t0.EMP_ID = t1.EMP_ID))
This is a case where a fast operation in java does not translate to an equally fast operation in SQL, requiring a correlated subselect.

        // Create an anoymous subquery that will get its reference class
        // set during SubSelectExpression.normalize.
        ReportQuery subQuery = new ReportQuery();
        subQuery.addCount();
        subQuery.setSelectionCriteria(subQuery.getExpressionBuilder().equal(this.anyOf(attributeName)));
        return subQuery(subQuery);
    
public oracle.toplink.essentials.expressions.Expressionsome(byte[] theBytes)
PUBLIC: Return an expression that is used with a comparison expression. The SOME keyword denotes that the search condition is TRUE if the comparison is TRUE for at least one of the values that is returned. If the subquery returns no value, the search condition is FALSE

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theBytes.length; index++) {
            vector.addElement(new Byte(theBytes[index]));
        }

        return some(vector);
    
public oracle.toplink.essentials.expressions.Expressionsome(char[] theChars)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theChars.length; index++) {
            vector.addElement(new Character(theChars[index]));
        }

        return some(vector);
    
public oracle.toplink.essentials.expressions.Expressionsome(double[] theDoubles)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theDoubles.length; index++) {
            vector.addElement(new Double(theDoubles[index]));
        }

        return some(vector);
    
public oracle.toplink.essentials.expressions.Expressionsome(float[] theFloats)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theFloats.length; index++) {
            vector.addElement(new Float(theFloats[index]));
        }

        return some(vector);
    
public oracle.toplink.essentials.expressions.Expressionsome(int[] theInts)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theInts.length; index++) {
            vector.addElement(new Integer(theInts[index]));
        }

        return some(vector);
    
public oracle.toplink.essentials.expressions.Expressionsome(long[] theLongs)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theLongs.length; index++) {
            vector.addElement(new Long(theLongs[index]));
        }

        return some(vector);
    
public oracle.toplink.essentials.expressions.Expressionsome(java.lang.Object[] theObjects)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theObjects.length; index++) {
            vector.addElement(theObjects[index]);
        }

        return some(vector);
    
public oracle.toplink.essentials.expressions.Expressionsome(short[] theShorts)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theShorts.length; index++) {
            vector.addElement(new Short(theShorts[index]));
        }

        return some(vector);
    
public oracle.toplink.essentials.expressions.Expressionsome(boolean[] theBooleans)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

        Vector vector = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();

        for (int index = 0; index < theBooleans.length; index++) {
            vector.addElement(new Boolean(theBooleans[index]));
        }

        return some(vector);
    
public oracle.toplink.essentials.expressions.Expressionsome(java.util.Vector theObjects)
PUBLIC: Return an expression that checks if the receivers value is contained in the collection. This is equivalent to the SQL "IN" operator and Java "contains" operator.

Example:

TopLink: employee.get("age").in(agesVector) Java: agesVector.contains(employee.getAge()) SQL: AGE IN (55, 18, 30)

        return some(new ConstantExpression(theObjects, this));
    
public oracle.toplink.essentials.expressions.Expressionsome(oracle.toplink.essentials.expressions.Expression arguments)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Some);
        return anOperator.expressionFor(this, arguments);
    
public oracle.toplink.essentials.expressions.Expressionsome(oracle.toplink.essentials.queryframework.ReportQuery subQuery)

        return some(subQuery(subQuery));
    
public oracle.toplink.essentials.expressions.ExpressionstandardDeviation()
PUBLIC: This represents the aggregate function StandardDeviation. Can be used only within Report Queries.

        return getFunction(ExpressionOperator.StandardDeviation);
    
public oracle.toplink.essentials.expressions.ExpressionsubQuery(oracle.toplink.essentials.queryframework.ReportQuery subQuery)
PUBLIC: Return a sub query expression. A sub query using a report query to define a subselect within another queries expression or select's where clause. The sub query (the report query) will use its own expression builder be can reference expressions from the base expression builder.

Example:

ExpressionBuilder builder = new ExpressionBuilder(); ReportQuery subQuery = new ReportQuery(Employee.class, new ExpressionBuilder()); subQuery.addMaximum("salary"); builder.get("salary").equal(builder.subQuery(subQuery));

        return new SubSelectExpression(subQuery, this);
    
public oracle.toplink.essentials.expressions.Expressionsubstring(int startPosition, int size)
PUBLIC: Function, returns the substring from the souce string.

        return substring(new Integer(startPosition), new Integer(size));
    
public oracle.toplink.essentials.expressions.Expressionsubstring(java.lang.Object startPosition, java.lang.Object size)
PUBLIC: Function, returns the substring from the souce string.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Substring);
        Vector args = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        args.addElement(startPosition);
        args.addElement(size);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.Expressionsum()
PUBLIC: This represents the aggregate function Sum. Can be used only within Report Queries.

        return getFunction(ExpressionOperator.Sum);
    
public oracle.toplink.essentials.expressions.ExpressiontoChar()
PUBLIC: Return an expression that represents the receiver value converted to a character string. This is equivalent to the SQL "TO_CHAR" operator and Java "toString" method.

Example:

TopLink: employee.get("salary").toChar().equal("100000") Java: employee.getSalary().toString().equals("100000") SQL: TO_CHAR(SALARY) = '100000'

        ExpressionOperator anOperator = getOperator(ExpressionOperator.ToChar);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressiontoChar(java.lang.String format)
PUBLIC: Return an expression that represents the receiver value converted to a character string, with the database formating options (i.e. 'year', 'yyyy', 'day', etc.). This is equivalent to the SQL "TO_CHAR" operator and Java Date API.

Example:

TopLink: employee.get("startDate").toChar("day").equal("monday") Java: employee.getStartDate().getDay().equals("monday") SQL: TO_CHAR(START_DATE, 'day') = 'monday'

        ExpressionOperator anOperator = getOperator(ExpressionOperator.ToCharWithFormat);
        return anOperator.expressionFor(this, format);
    
public oracle.toplink.essentials.expressions.ExpressiontoCharacter()
PUBLIC: Function, returns the single character string with the ascii or character set value.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Chr);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressiontoDate()
PUBLIC: Function, returns date from the string using the default format.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.ToDate);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressiontoLowerCase()
PUBLIC: Return an expression that represents the receiver value converted to lower case. This is equivalent to the SQL "LOWER" operator and Java "toLowerCase" method. This is only allowed for String attribute values.

Example:

TopLink: employee.get("firstName").toLowerCase().equal("bob") Java: employee.getFirstName().toLowerCase().equals("bob") SQL: LOWER(F_NAME) = 'bob'

        ExpressionOperator anOperator = getOperator(ExpressionOperator.ToLowerCase);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressiontoNumber()
PUBLIC: Function, returns the number converted from the string.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.ToNumber);
        return anOperator.expressionFor(this);
    
public java.lang.StringtoString()
PUBLIC: Print a debug form of the expression tree.

        try {
            StringWriter innerWriter = new StringWriter();
            BufferedWriter outerWriter = new BufferedWriter(innerWriter);
            toString(outerWriter, 0);
            outerWriter.flush();
            return innerWriter.toString();
        } catch (IOException e) {
            return ToStringLocalization.buildMessage("error_printing_expression", (Object[])null);
        }
    
public voidtoString(java.io.BufferedWriter writer, int indent)
INTERNAL: Print a debug form of the expression tree.

        writer.newLine();
        for (int i = 0; i < indent; i++) {
            writer.write("   ");
        }
        writer.write(descriptionOfNodeType());
        writer.write(" ");
        writeDescriptionOn(writer);
        writeSubexpressionsTo(writer, indent + 1);
    
public oracle.toplink.essentials.expressions.ExpressiontoUpperCase()
PUBLIC: Return an expression that represents the receiver value converted to upper case. This is equivalent to the SQL "UPPER" operator and Java "toUpperCase" method. This is only allowed for String attribute values.

Example:

TopLink: employee.get("firstName").toUpperCase().equal("BOB") Java: employee.getFirstName().toUpperCase().equals("BOB") SQL: UPPER(F_NAME) = 'BOB'

        ExpressionOperator anOperator = getOperator(ExpressionOperator.ToUpperCase);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.ExpressiontoUppercaseCasedWords()
PUBLIC: Function, returns the string with the first letter of each word capitalized.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Initcap);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.Expressiontranslate(java.lang.Object fromString, java.lang.Object toString)
PUBLIC: Function, returns the string with each char from the from string converted to the char in the to string.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Translate);
        Vector args = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(2);
        args.addElement(fromString);
        args.addElement(toString);
        return anOperator.expressionForArguments(this, args);
    
public oracle.toplink.essentials.expressions.Expressiontrim()
PUBLIC: Function, returns the string trimmed for white space.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Trim);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.Expressiontrim(java.lang.Object substring)
PUBLIC: Function, returns the string right and left trimmed for the substring.

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Trim2);
        return anOperator.expressionForWithBaseLast(this, substring);
    
public oracle.toplink.essentials.expressions.ExpressiontruncateDate(java.lang.String datePart)
PUBLIC: return the date truncated to the indicated datePart. Equivalent to the Sybase TRUNC function for dates

Example:

TopLink: employee.get("date").truncDate(year) Java: NA SQL: TRUNC(date, year)

        ExpressionOperator anOperator = getOperator(ExpressionOperator.TruncateDate);
        return anOperator.expressionFor(this, datePart);

    
public oracle.toplink.essentials.expressions.Expressiontwist(oracle.toplink.essentials.expressions.Expression expression, oracle.toplink.essentials.expressions.Expression newBase)
INTERNAL: We are given an expression that comes from a different context than the one in which this was built, e.g. it is the selection criteria of a mapping, or the criteria on which multiple tables are joined in a descriptor. We need to transform it so it refers to the objects we are dealing with, and AND it into the rest of our expression. We want to replace the original base expression with , and any parameters will be given values based on the context which provides. For example, suppose that the main expression is emp.address.streetName = 'something' and we are trying to twist the selection criteria for the mapping 'address' in Employee. Because that mapping selects addresses, we will use the 'address' node as the base. Values for any parameters will come from the 'emp' node, which was the base of the original expression. Note that the values need not be constants, they can be fields. We do this by taking the tree we're trying to merge and traverse it more or less re-executing it it with the appropriate initial receiver and context. Return the root of the new expression tree. This will probably need to be AND'ed with the root of the old tree.

        if (expression == null) {
            return null;
        }
        return expression.twistedForBaseAndContext(newBase, this);

    
public oracle.toplink.essentials.expressions.ExpressiontwistedForBaseAndContext(oracle.toplink.essentials.expressions.Expression newBase, oracle.toplink.essentials.expressions.Expression context)
INTERNAL: Rebuild myself against the base, with the values of parameters supplied by the context expression. This is used for transforming a standalone expression (e.g. the join criteria of a mapping) into part of some larger expression. You normally would not call this directly, instead calling twist See the comment there for more details"

        // Will be overridden by subclasses
        return this;
    
public voidvalidateNode()
INTERNAL: Do any required validation for this node. Throw an exception for any incorrect constructs.

    
public oracle.toplink.essentials.expressions.Expressionvalue()
PUBLIC: Function, this represents the value function, used in nestedtable

        ExpressionOperator anOperator = getOperator(ExpressionOperator.Value);
        return anOperator.expressionFor(this);
    
public oracle.toplink.essentials.expressions.Expressionvalue(byte constant)
PUBLIC: Return an expression on the constant.

Example:

reportQuery.addItem("a constant", builder.value("a constant"));

        return value(new Byte(constant));
    
public oracle.toplink.essentials.expressions.Expressionvalue(char constant)
PUBLIC: Return an expression on the constant.

Example:

reportQuery.addItem("a constant", builder.value("a constant"));

        return value(new Character(constant));
    
public oracle.toplink.essentials.expressions.Expressionvalue(double constant)
PUBLIC: Return an expression on the constant.

Example:

reportQuery.addItem("a constant", builder.value("a constant"));

        return value(new Double(constant));
    
public oracle.toplink.essentials.expressions.Expressionvalue(float constant)
PUBLIC: Return an expression on the constant.

Example:

reportQuery.addItem("a constant", builder.value("a constant"));

        return value(new Float(constant));
    
public oracle.toplink.essentials.expressions.Expressionvalue(int constant)
PUBLIC: Return an expression on the constant.

Example:

reportQuery.addItem("a constant", builder.value("a constant"));

        return value(new Integer(constant));
    
public oracle.toplink.essentials.expressions.Expressionvalue(long constant)
PUBLIC: Return an expression on the constant.

Example:

reportQuery.addItem("a constant", builder.value("a constant"));

        return value(new Long(constant));
    
public oracle.toplink.essentials.expressions.Expressionvalue(java.lang.Object constant)
PUBLIC: Return an expression on the constant.

Example:

reportQuery.addItem("a constant", builder.value("a constant"));

        return new ConstantExpression(constant, this);
    
public oracle.toplink.essentials.expressions.Expressionvalue(short constant)
PUBLIC: Return an expression on the constant.

Example:

reportQuery.addItem("a constant", builder.value("a constant"));

        return value(new Short(constant));
    
public oracle.toplink.essentials.expressions.Expressionvalue(boolean constant)
PUBLIC: Return an expression on the constant.

Example:

reportQuery.addItem("a constant", builder.value("a constant"));

        return value(new Boolean(constant));
    
public java.lang.ObjectvalueFromObject(java.lang.Object object, oracle.toplink.essentials.internal.sessions.AbstractSession session, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow, oracle.toplink.essentials.queryframework.InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean isObjectUnregistered)
INTERNAL: Return the value for in memory comparison. This is only valid for valueable expressions. New parameter added for feature 2612601

param
isObjectRegistered true if object possibly not a clone, but is being conformed against the unit of work cache.

        throw QueryException.cannotConformExpression();
    
public java.lang.ObjectvalueFromObject(java.lang.Object object, oracle.toplink.essentials.internal.sessions.AbstractSession session, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow, oracle.toplink.essentials.queryframework.InMemoryQueryIndirectionPolicy valueHolderPolicy)
INTERNAL: Return the value for in memory comparison. This is only valid for valueable expressions.

        return valueFromObject(object, session, translationRow, valueHolderPolicy, false);
    
public oracle.toplink.essentials.expressions.Expressionvariance()
PUBLIC: Function, this represents the aggregate function Variance. Can be used only within Report Queries.

        return getFunction(ExpressionOperator.Variance);
    
public voidwriteDescriptionOn(java.io.BufferedWriter writer)
INTERNAL: Used to print a debug form of the expression tree.

        writer.write("some expression");
    
protected voidwriteField(oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer, oracle.toplink.essentials.internal.helper.DatabaseField field, oracle.toplink.essentials.internal.expressions.SQLSelectStatement statement)
INTERNAL: Append the field name to the writer. Should be overriden for special operators such as functions.

        //print ", " before each selected field except the first one
        if (printer.isFirstElementPrinted()) {
            printer.printString(", ");
        } else {
            printer.setIsFirstElementPrinted(true);
        }

        if (statement.requiresAliases()) {
            if (field.getTable() != lastTable) {
                lastTable = field.getTable();
                currentAlias = aliasForTable(lastTable);
            }
            printer.printString(currentAlias.getQualifiedName());
            printer.printString(".");
            printer.printString(field.getName());
        } else {
            printer.printString(field.getName());
        }
    
public voidwriteFields(oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer, java.util.Vector newFields, oracle.toplink.essentials.internal.expressions.SQLSelectStatement statement)
INTERNAL: called from SQLSelectStatement.writeFieldsFromExpression(...)

        for (Enumeration fieldsEnum = getFields().elements(); fieldsEnum.hasMoreElements();) {
            DatabaseField field = (DatabaseField)fieldsEnum.nextElement();
            newFields.addElement(field);
            writeField(printer, field, statement);
        }
    
public voidwriteSubexpressionsTo(java.io.BufferedWriter writer, int indent)
INTERNAL: Used in SQL printing.

        // In general, there are no sub-expressions