Methods Summary |
---|
public oracle.toplink.essentials.expressions.Expression | addDate(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.Expression | addDate(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.Expression | addMonths(int months)PUBLIC:
Function, to add months to a date.
return addMonths(new Integer(months));
|
public oracle.toplink.essentials.expressions.Expression | addMonths(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.DatabaseTable | aliasForTable(oracle.toplink.essentials.internal.helper.DatabaseTable table)INTERNAL:
Find the alias for a given table
return null;
|
public oracle.toplink.essentials.expressions.Expression | all(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.Expression | all(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.Expression | all(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.Expression | all(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.Expression | all(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.Expression | all(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.Expression | all(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.Expression | all(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.Expression | all(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.Expression | all(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.Expression | all(oracle.toplink.essentials.expressions.Expression arguments)
ExpressionOperator anOperator = getOperator(ExpressionOperator.All);
return anOperator.expressionFor(this, arguments);
|
public oracle.toplink.essentials.expressions.Expression | all(oracle.toplink.essentials.queryframework.ReportQuery subQuery)
return all(subQuery(subQuery));
|
public oracle.toplink.essentials.expressions.Expression | allOf(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.
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.Expression | and(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.Expression | any(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.Expression | any(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.Expression | any(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.Expression | any(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.Expression | any(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.Expression | any(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.Expression | any(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.Expression | any(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.Expression | any(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.Expression | any(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.Expression | any(oracle.toplink.essentials.expressions.Expression arguments)
ExpressionOperator anOperator = getOperator(ExpressionOperator.Any);
return anOperator.expressionFor(this, arguments);
|
public oracle.toplink.essentials.expressions.Expression | any(oracle.toplink.essentials.queryframework.ReportQuery subQuery)
return any(subQuery(subQuery));
|
public oracle.toplink.essentials.expressions.Expression | anyOf(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.Expression | anyOfAllowingNone(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.Expression | ascending()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.Expression | asciiValue()PUBLIC:
Function, returns the single character strings ascii value.
ExpressionOperator anOperator = getOperator(ExpressionOperator.Ascii);
return anOperator.expressionFor(this);
|
protected void | assignAlias(java.lang.String name, oracle.toplink.essentials.internal.helper.DatabaseTable tableOrExpression)INTERNAL:
Alias a particular table within this node
// By default, do nothing.
|
public int | assignTableAliasesStartingAt(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.Expression | average()PUBLIC:
Function, This represents the aggregate function Average. Can be used only within Report Queries.
return getFunction(ExpressionOperator.Average);
|
public oracle.toplink.essentials.expressions.Expression | between(byte leftValue, byte rightValue)PUBLIC:
Function, between two bytes
return between(new Byte(leftValue), new Byte(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | between(char leftChar, char rightChar)PUBLIC:
Function, between two chars
return between(new Character(leftChar), new Character(rightChar));
|
public oracle.toplink.essentials.expressions.Expression | between(double leftValue, double rightValue)PUBLIC:
Function, between two doubles
return between(new Double(leftValue), new Double(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | between(float leftValue, float rightValue)PUBLIC:
Function, between two floats
return between(new Float(leftValue), new Float(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | between(int leftValue, int rightValue)PUBLIC:
Function, between two ints
return between(new Integer(leftValue), new Integer(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | between(long leftValue, long rightValue)PUBLIC:
Function, between two longs
return between(new Long(leftValue), new Long(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | between(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.Expression | between(oracle.toplink.essentials.expressions.Expression leftExpression, oracle.toplink.essentials.expressions.Expression rightExpression)
return between((Object)leftExpression, (Object)rightExpression);
|
public oracle.toplink.essentials.expressions.Expression | between(short leftValue, short rightValue)PUBLIC:
Function, between two shorts
return between(new Short(leftValue), new Short(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | caseStatement(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"
/**
* 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.Object | clone()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.Expression | cloneUsing(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.
// 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.Expression | concat(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.Expression | containsAllKeyWords(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.Expression | containsAnyKeyWords(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.Expression | containsSubstring(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.Expression | containsSubstring(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.Expression | containsSubstringIgnoringCase(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.Expression | containsSubstringIgnoringCase(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 void | convertNodeToUseOuterJoin()
|
public oracle.toplink.essentials.expressions.Expression | convertToUseOuterJoin()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.Expression | copiedVersionFrom(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.Expression | count()PUBLIC:
This represents the aggregate function Average. Can be used only within Report Queries.
return getFunction(ExpressionOperator.Count);
|
public oracle.toplink.essentials.expressions.Expression | create(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.Expression | create(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.Expression | createWithBaseLast(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.Expression | currentDate()PUBLIC:
This gives access to the current date on the database through expression.
return getFunction(ExpressionOperator.Today);
|
public oracle.toplink.essentials.expressions.Expression | currentDateDate()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.Expression | currentTime()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.Expression | currentTimeStamp()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.Expression | dateDifference(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.Expression | dateDifference(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.Expression | dateName(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.Expression | datePart(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.Expression | dateToString()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.Expression | decode(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")
/**
* 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.Expression | descending()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.String | descriptionOfNodeType()INTERNAL:
Used in debug printing of this node.
return "Expression";
|
public boolean | detectExpression(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.Expression | difference(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.Expression | distinct()PUBLIC:
Function, This represents the distinct option inside an aggregate function. Can be used only within Report Queries.
return getFunction(ExpressionOperator.Distinct);
|
public boolean | doesConform(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 boolean | doesConform(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
throw QueryException.cannotConformExpression();
|
public oracle.toplink.essentials.expressions.Expression | equal(byte theValue)
return equal(new Byte(theValue));
|
public oracle.toplink.essentials.expressions.Expression | equal(char theChar)
return equal(new Character(theChar));
|
public oracle.toplink.essentials.expressions.Expression | equal(double theValue)
return equal(new Double(theValue));
|
public oracle.toplink.essentials.expressions.Expression | equal(float theValue)
return equal(new Float(theValue));
|
public oracle.toplink.essentials.expressions.Expression | equal(int theValue)
return equal(new Integer(theValue));
|
public oracle.toplink.essentials.expressions.Expression | equal(long theValue)
return equal(new Long(theValue));
|
public oracle.toplink.essentials.expressions.Expression | equal(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.Expression | equal(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
ExpressionOperator anOperator = getOperator(ExpressionOperator.Equal);
return anOperator.expressionFor(this, theValue);
|
public oracle.toplink.essentials.expressions.Expression | equal(short theValue)
return equal(new Short(theValue));
|
public oracle.toplink.essentials.expressions.Expression | equal(boolean theBoolean)
return equal(new Boolean(theBoolean));
|
public oracle.toplink.essentials.expressions.Expression | equalOuterJoin(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.Expression | equalOuterJoin(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.Expression | equalsIgnoreCase(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.Expression | equalsIgnoreCase(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.Expression | exists(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.Expression | existsNode(java.lang.String path)PUBLIC:
XMLType Function, gets the number of nodes returned by the given xpath expression
returns 0 if there are none
ExpressionOperator anOperator = getOperator(ExpressionOperator.ExistsNode);
return anOperator.expressionFor(this, path);
|
public oracle.toplink.essentials.expressions.Expression | extract(java.lang.String path)PUBLIC:
XMLType Function, extracts a secton of XML from a larget XML document
ExpressionOperator anOperator = getOperator(ExpressionOperator.Extract);
return anOperator.expressionFor(this, path);
|
public boolean | extractPrimaryKeyValues(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.Expression | extractValue(java.lang.String path)PUBLIC:
XMLType Function, extracts a value from an XMLType field
ExpressionOperator anOperator = getOperator(ExpressionOperator.ExtractValue);
return anOperator.expressionFor(this, path);
|
public static oracle.toplink.essentials.expressions.Expression | from(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.Expression | fromConstant(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.Expression | fromLiteral(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.Expression | get(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.Expression | get(java.lang.String attributeName, java.util.Vector arguments)INTERNAL:
return null;
|
public oracle.toplink.essentials.expressions.Expression | getAllowingNull(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.Expression | getAllowingNull(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.ExpressionBuilder | getBuilder()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.DatabaseField | getClonedField()INTERNAL:
If there are any fields associated with this expression, return them
return null;
|
public oracle.toplink.essentials.expressions.Expression | getField(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.Expression | getField(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.Object | getFieldValue(java.lang.Object objectValue)INTERNAL:
Transform the object-level value into a database-level value
return objectValue;
|
public java.util.Vector | getFields()INTERNAL:
return oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1);
|
public oracle.toplink.essentials.expressions.Expression | getFunction(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.
ExpressionOperator anOperator = getOperator(selector);
return anOperator.expressionFor(this);
|
public oracle.toplink.essentials.expressions.Expression | getFunction(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.
ExpressionOperator anOperator = getOperator(selector);
return anOperator.expressionForArguments(this, arguments);
|
public oracle.toplink.essentials.expressions.Expression | getFunction(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.Expression | getFunction(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.Expression | getFunctionWithArguments(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.String | getName()INTERNAL:
return "";
|
public oracle.toplink.essentials.expressions.Expression | getNumberVal()PUBLIC:
XMLType Function - gets a number value from an XMLType
ExpressionOperator anOperator = getOperator(ExpressionOperator.GetNumberVal);
return anOperator.expressionFor(this);
|
public oracle.toplink.essentials.expressions.ExpressionOperator | getOperator()INTERNAL:
Most expression have operators, so this is just a convenience method.
return null;
|
public oracle.toplink.essentials.expressions.ExpressionOperator | getOperator(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.Vector | getOwnedTables()INTERNAL:
Return the tables that this node owns for purposes of table aliasing.
return null;
|
public oracle.toplink.essentials.expressions.Expression | getParameter(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.Expression | getParameter(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.Expression | getParameter(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.AbstractSession | getSession()INTERNAL:
return getBuilder().getSession();
|
public oracle.toplink.essentials.expressions.Expression | getStringVal()PUBLIC:
XMLType Function - gets a string value from an XMLType
ExpressionOperator anOperator = getOperator(ExpressionOperator.GetStringVal);
return anOperator.expressionFor(this);
|
public oracle.toplink.essentials.expressions.Expression | getTable(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.Expression | getTable(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.TableAliasLookup | getTableAliases()INTERNAL:
Return the aliases used. By default, return null, since we don't have tables.
return null;
|
public oracle.toplink.essentials.expressions.Expression | greaterThan(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.Expression | greaterThan(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.Expression | greaterThan(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.Expression | greaterThan(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.Expression | greaterThan(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.Expression | greaterThan(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.Expression | greaterThan(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.Expression | greaterThan(oracle.toplink.essentials.expressions.Expression theValue)
ExpressionOperator anOperator = getOperator(ExpressionOperator.GreaterThan);
return anOperator.expressionFor(this, theValue);
|
public oracle.toplink.essentials.expressions.Expression | greaterThan(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.Expression | greaterThan(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.Expression | greaterThanEqual(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.Expression | greaterThanEqual(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.Expression | greaterThanEqual(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.Expression | greaterThanEqual(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.Expression | greaterThanEqual(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.Expression | greaterThanEqual(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.Expression | greaterThanEqual(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.Expression | greaterThanEqual(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.Expression | greaterThanEqual(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.Expression | greaterThanEqual(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 boolean | hasAsOfClause()ADVANCED:
Answers true if this is to be queried as of a past time.
return false;
|
public boolean | hasBeenAliased()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.Expression | hexToRaw()PUBLIC:
Function, returns binary array value for the hex string.
ExpressionOperator anOperator = getOperator(ExpressionOperator.HexToRaw);
return anOperator.expressionFor(this);
|
public oracle.toplink.essentials.expressions.Expression | ifNull(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.Expression | in(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.Expression | in(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.Expression | in(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.Expression | in(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.Expression | in(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.Expression | in(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.Expression | in(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.Expression | in(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.Expression | in(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.Expression | in(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.Expression | in(oracle.toplink.essentials.expressions.Expression arguments)
ExpressionOperator anOperator = getOperator(ExpressionOperator.In);
return anOperator.expressionFor(this, arguments);
|
public oracle.toplink.essentials.expressions.Expression | in(oracle.toplink.essentials.queryframework.ReportQuery subQuery)
ExpressionOperator anOperator = getOperator(ExpressionOperator.InSubQuery);
return anOperator.expressionFor(this, subQuery);
|
public oracle.toplink.essentials.expressions.Expression | indexOf(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 boolean | isCompoundExpression()INTERNAL:
return false;
|
public boolean | isConstantExpression()INTERNAL:
return false;
|
public boolean | isDataExpression()INTERNAL:
return false;
|
public oracle.toplink.essentials.expressions.Expression | isEmpty(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.
return size(attributeName).equal(0);
|
public boolean | isExpressionBuilder()INTERNAL:
return false;
|
public boolean | isFieldExpression()INTERNAL:
return false;
|
public oracle.toplink.essentials.expressions.Expression | isFragment()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 boolean | isFunctionExpression()INTERNAL:
return false;
|
public boolean | isLiteralExpression()INTERNAL:
return false;
|
public boolean | isLogicalExpression()INTERNAL:
return false;
|
public oracle.toplink.essentials.expressions.Expression | isNull()PUBLIC:
Compare to null.
ExpressionOperator anOperator = getOperator(ExpressionOperator.IsNull);
return anOperator.expressionFor(this);
|
public boolean | isObjectExpression()INTERNAL:
return false;
|
public boolean | isParameterExpression()INTERNAL:
return false;
|
public boolean | isQueryKeyExpression()INTERNAL:
return false;
|
public boolean | isRelationExpression()INTERNAL:
return false;
|
public boolean | isTableExpression()INTERNAL:
return false;
|
public boolean | isValueExpression()INTERNAL:
Subclasses implement (isParameterExpression() || isConstantExpression())
return false;
|
public void | iterateOn(oracle.toplink.essentials.internal.expressions.ExpressionIterator iterator)INTERNAL:
For iterating using an inner class
iterator.iterate(this);
|
public oracle.toplink.essentials.expressions.Expression | lastDay()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.Expression | leftPad(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.Expression | leftPad(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.Expression | leftTrim()PUBLIC:
Function, returns the string left trimmed for white space.
ExpressionOperator anOperator = getOperator(ExpressionOperator.LeftTrim);
return anOperator.expressionFor(this);
|
public oracle.toplink.essentials.expressions.Expression | leftTrim(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.Expression | length()PUBLIC:
Function, returns the size of the string.
ExpressionOperator anOperator = getOperator(ExpressionOperator.Length);
return anOperator.expressionFor(this);
|
public oracle.toplink.essentials.expressions.Expression | lessThan(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.Expression | lessThan(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.Expression | lessThan(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.Expression | lessThan(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.Expression | lessThan(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.Expression | lessThan(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.Expression | lessThan(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.Expression | lessThan(oracle.toplink.essentials.expressions.Expression theValue)
ExpressionOperator anOperator = getOperator(ExpressionOperator.LessThan);
return anOperator.expressionFor(this, theValue);
|
public oracle.toplink.essentials.expressions.Expression | lessThan(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.Expression | lessThan(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.Expression | lessThanEqual(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.Expression | lessThanEqual(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.Expression | lessThanEqual(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.Expression | lessThanEqual(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.Expression | lessThanEqual(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.Expression | lessThanEqual(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.Expression | lessThanEqual(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.Expression | lessThanEqual(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.Expression | lessThanEqual(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.Expression | lessThanEqual(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.Expression | like(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.Expression | like(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.Expression | like(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.Expression | like(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.Expression | likeIgnoreCase(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.Expression | likeIgnoreCase(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.Expression | literal(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.Expression | locate(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.Expression | locate(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.Expression | locate(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.Expression | maximum()PUBLIC:
This represents the aggregate function Maximum. Can be used only within Report Queries.
return getFunction(ExpressionOperator.Maximum);
|
public oracle.toplink.essentials.expressions.Expression | minimum()PUBLIC:
This represents the aggregate function Minimum. Can be used only within Report Queries.
return getFunction(ExpressionOperator.Minimum);
|
public oracle.toplink.essentials.expressions.Expression | monthsBetween(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.Expression | newTime(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.Expression | nextDay(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.Expression | noneOf(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);
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.Expression | normalize(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.Expression | not()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.Expression | notBetween(byte leftValue, byte rightValue)PUBLIC:
Return an expression that compares if the receivers value is not between two other values.
Equivalent to between negated.
return notBetween(new Byte(leftValue), new Byte(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | notBetween(char leftChar, char rightChar)PUBLIC:
Return an expression that compares if the receivers value is not between two other values.
Equivalent to between negated.
return notBetween(new Character(leftChar), new Character(rightChar));
|
public oracle.toplink.essentials.expressions.Expression | notBetween(double leftValue, double rightValue)PUBLIC:
Return an expression that compares if the receivers value is not between two other values.
Equivalent to between negated.
return notBetween(new Double(leftValue), new Double(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | notBetween(float leftValue, float rightValue)PUBLIC:
Return an expression that compares if the receivers value is not between two other values.
Equivalent to between negated.
return notBetween(new Float(leftValue), new Float(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | notBetween(int leftValue, int rightValue)PUBLIC:
Return an expression that compares if the receivers value is not between two other values.
Equivalent to between negated.
return notBetween(new Integer(leftValue), new Integer(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | notBetween(long leftValue, long rightValue)PUBLIC:
Return an expression that compares if the receivers value is not between two other values.
Equivalent to between negated.
return notBetween(new Long(leftValue), new Long(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | notBetween(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.
return between(leftValue, rightValue).not();
|
public oracle.toplink.essentials.expressions.Expression | notBetween(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.
return between(leftExpression, rightExpression).not();
|
public oracle.toplink.essentials.expressions.Expression | notBetween(short leftValue, short rightValue)PUBLIC:
Return an expression that compares if the receivers value is not between two other values.
Equivalent to between negated.
return notBetween(new Short(leftValue), new Short(rightValue));
|
public oracle.toplink.essentials.expressions.Expression | notEmpty(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.
return size(attributeName).greaterThan(0);
|
public oracle.toplink.essentials.expressions.Expression | notEqual(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
return notEqual(new Byte(theValue));
|
public oracle.toplink.essentials.expressions.Expression | notEqual(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
return notEqual(new Character(theChar));
|
public oracle.toplink.essentials.expressions.Expression | notEqual(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
return notEqual(new Double(theValue));
|
public oracle.toplink.essentials.expressions.Expression | notEqual(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
return notEqual(new Float(theValue));
|
public oracle.toplink.essentials.expressions.Expression | notEqual(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
return notEqual(new Integer(theValue));
|
public oracle.toplink.essentials.expressions.Expression | notEqual(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
return notEqual(new Long(theValue));
|
public oracle.toplink.essentials.expressions.Expression | notEqual(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
ExpressionOperator anOperator = getOperator(ExpressionOperator.NotEqual);
return anOperator.expressionFor(this, theValue);
|
public oracle.toplink.essentials.expressions.Expression | notEqual(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
ExpressionOperator anOperator = getOperator(ExpressionOperator.NotEqual);
return anOperator.expressionFor(this, theValue);
|
public oracle.toplink.essentials.expressions.Expression | notEqual(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
return notEqual(new Short(theValue));
|
public oracle.toplink.essentials.expressions.Expression | notEqual(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
return notEqual(new Boolean(theBoolean));
|
public oracle.toplink.essentials.expressions.Expression | notExists(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.Expression | notIn(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.Expression | notIn(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.Expression | notIn(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.Expression | notIn(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.Expression | notIn(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.Expression | notIn(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.Expression | notIn(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.Expression | notIn(oracle.toplink.essentials.queryframework.ReportQuery subQuery)
ExpressionOperator anOperator = getOperator(ExpressionOperator.NotInSubQuery);
return anOperator.expressionFor(this, subQuery);
|
public oracle.toplink.essentials.expressions.Expression | notIn(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.Expression | notIn(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.Expression | notIn(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.Expression | notIn(oracle.toplink.essentials.expressions.Expression arguments)
ExpressionOperator anOperator = getOperator(ExpressionOperator.NotIn);
return anOperator.expressionFor(this, arguments);
|
public oracle.toplink.essentials.expressions.Expression | notLike(java.lang.String aString)PUBLIC:
Return an expression that compares if the receivers value is not like the other value.
Equivalent to like negated.
return notLike(new ConstantExpression(aString, this));
|
public oracle.toplink.essentials.expressions.Expression | notLike(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.
ExpressionOperator anOperator = getOperator(ExpressionOperator.NotLike);
return anOperator.expressionFor(this, arguments);
|
public oracle.toplink.essentials.expressions.Expression | notNull()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.Expression | or(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.Expression | performOperator(oracle.toplink.essentials.expressions.ExpressionOperator anOperator, java.util.Vector args)INTERNAL:
return anOperator.expressionForArguments(this, args);
|
protected void | postCopyIn(java.util.Dictionary alreadyDone)
|
public oracle.toplink.essentials.expressions.Expression | postfixSQL(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.Expression | prefixSQL(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 void | printJava(oracle.toplink.essentials.internal.expressions.ExpressionJavaPrinter printer)INTERNAL:
Print java for project class generation
//do nothing
|
public abstract void | printSQL(oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer)INTERNAL:
Print SQL
|
public void | printSQLWithoutConversion(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.Expression | rebuildOn(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.
|
public oracle.toplink.essentials.expressions.Expression | ref()ADVANCED:
For Object-relational support.
return getFunction(ExpressionOperator.Ref);
|
protected oracle.toplink.essentials.expressions.Expression | registerIn(java.util.Dictionary alreadyDone)
Expression copy = (Expression)shallowClone();
alreadyDone.put(this, copy);
copy.postCopyIn(alreadyDone);
return copy;
|
public oracle.toplink.essentials.expressions.Expression | replace(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.Expression | replicate(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.Expression | replicate(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 void | resetCache()Reset cached information here so that we can be sure we're accurate.
|
public oracle.toplink.essentials.expressions.Expression | reverse()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.Expression | right(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.Expression | right(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.Expression | rightPad(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.Expression | rightPad(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.Expression | rightTrim()PUBLIC:
Function, returns the string right trimmed for white space.
ExpressionOperator anOperator = getOperator(ExpressionOperator.RightTrim);
return anOperator.expressionFor(this);
|
public oracle.toplink.essentials.expressions.Expression | rightTrim(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.Expression | roundDate(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 boolean | selectIfOrderedBy()PUBLIC:
Return whether this expression should be included in the SELECT clause if it is used
in an ORDER BY clause
return selectIfOrderedBy;
|
public void | setLocalBase(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 void | setSelectIfOrderedBy(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.
this.selectIfOrderedBy = selectIfOrderedBy;
|
public oracle.toplink.essentials.expressions.Expression | shallowClone()INTERNAL:
Expression result = null;
try {
result = (Expression)super.clone();
} catch (CloneNotSupportedException e) {
}
;
return result;
|
public oracle.toplink.essentials.expressions.Expression | size(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.Expression | some(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.Expression | some(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.Expression | some(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.Expression | some(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.Expression | some(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.Expression | some(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.Expression | some(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.Expression | some(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.Expression | some(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.Expression | some(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.Expression | some(oracle.toplink.essentials.expressions.Expression arguments)
ExpressionOperator anOperator = getOperator(ExpressionOperator.Some);
return anOperator.expressionFor(this, arguments);
|
public oracle.toplink.essentials.expressions.Expression | some(oracle.toplink.essentials.queryframework.ReportQuery subQuery)
return some(subQuery(subQuery));
|
public oracle.toplink.essentials.expressions.Expression | standardDeviation()PUBLIC:
This represents the aggregate function StandardDeviation. Can be used only within Report Queries.
return getFunction(ExpressionOperator.StandardDeviation);
|
public oracle.toplink.essentials.expressions.Expression | subQuery(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.Expression | substring(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.Expression | substring(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.Expression | sum()PUBLIC:
This represents the aggregate function Sum. Can be used only within Report Queries.
return getFunction(ExpressionOperator.Sum);
|
public oracle.toplink.essentials.expressions.Expression | toChar()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.Expression | toChar(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.Expression | toCharacter()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.Expression | toDate()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.Expression | toLowerCase()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.Expression | toNumber()PUBLIC:
Function, returns the number converted from the string.
ExpressionOperator anOperator = getOperator(ExpressionOperator.ToNumber);
return anOperator.expressionFor(this);
|
public java.lang.String | toString()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 void | toString(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.Expression | toUpperCase()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.Expression | toUppercaseCasedWords()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.Expression | translate(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.Expression | trim()PUBLIC:
Function, returns the string trimmed for white space.
ExpressionOperator anOperator = getOperator(ExpressionOperator.Trim);
return anOperator.expressionFor(this);
|
public oracle.toplink.essentials.expressions.Expression | trim(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.Expression | truncateDate(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.Expression | twist(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.Expression | twistedForBaseAndContext(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 void | validateNode()INTERNAL:
Do any required validation for this node. Throw an exception for any incorrect constructs.
|
public oracle.toplink.essentials.expressions.Expression | value()PUBLIC:
Function, this represents the value function, used in nestedtable
ExpressionOperator anOperator = getOperator(ExpressionOperator.Value);
return anOperator.expressionFor(this);
|
public oracle.toplink.essentials.expressions.Expression | value(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.Expression | value(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.Expression | value(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.Expression | value(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.Expression | value(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.Expression | value(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.Expression | value(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.Expression | value(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.Expression | value(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.Object | valueFromObject(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
throw QueryException.cannotConformExpression();
|
public java.lang.Object | valueFromObject(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.Expression | variance()PUBLIC:
Function, this represents the aggregate function Variance. Can be used only within Report Queries.
return getFunction(ExpressionOperator.Variance);
|
public void | writeDescriptionOn(java.io.BufferedWriter writer)INTERNAL:
Used to print a debug form of the expression tree.
writer.write("some expression");
|
protected void | writeField(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 void | writeFields(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 void | writeSubexpressionsTo(java.io.BufferedWriter writer, int indent)INTERNAL:
Used in SQL printing.
// In general, there are no sub-expressions
|