Methods Summary |
---|
public oracle.toplink.essentials.internal.helper.DatabaseTable | aliasForTable(oracle.toplink.essentials.internal.helper.DatabaseTable table)INTERNAL:
Find the alias for a given table from the first or second child in the additionalOuterJoinCriteria
DatabaseTable alias = null;
if (getFirstChild() != null) {
alias = getFirstChild().aliasForTable(table);
}
if ((alias == null) && (getSecondChild() != null)) {
alias = getSecondChild().aliasForTable(table);
}
return alias;
|
public oracle.toplink.essentials.expressions.Expression | create(oracle.toplink.essentials.expressions.Expression base, java.lang.Object singleArgument, oracle.toplink.essentials.expressions.ExpressionOperator operator)INTERNAL:
setFirstChild(base);
Expression argument = Expression.from(singleArgument, base);
setSecondChild(argument);
setOperator(operator);
return this;
|
public oracle.toplink.essentials.expressions.Expression | create(oracle.toplink.essentials.expressions.Expression base, java.util.Vector arguments, oracle.toplink.essentials.expressions.ExpressionOperator operator)INTERNAL:
setFirstChild(base);
if (!arguments.isEmpty()) {
setSecondChild((Expression)arguments.firstElement());
}
setOperator(operator);
return this;
|
public java.lang.String | descriptionOfNodeType()INTERNAL:
Used for debug printing.
return "Compound Expression";
|
public oracle.toplink.essentials.expressions.ExpressionBuilder | getBuilder()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)
ExpressionBuilder builder = getFirstChild().getBuilder();
if (builder == null) {
return getSecondChild().getBuilder();
} else {
return builder;
}
|
public oracle.toplink.essentials.expressions.Expression | getFirstChild()
return firstChild;
|
public oracle.toplink.essentials.expressions.ExpressionOperator | getOperator()
return operator;
|
public oracle.toplink.essentials.expressions.ExpressionOperator | getPlatformOperator(oracle.toplink.essentials.internal.databaseaccess.DatabasePlatform platform)
if (platformOperator == null) {
initializePlatformOperator(platform);
}
return platformOperator;
|
public oracle.toplink.essentials.expressions.Expression | getSecondChild()
return secondChild;
|
public void | initializePlatformOperator(oracle.toplink.essentials.internal.databaseaccess.DatabasePlatform platform)INTERNAL:
if (getOperator().isComplete()) {
platformOperator = getOperator();
return;
}
platformOperator = platform.getOperator(getOperator().getSelector());
if (platformOperator == null) {
throw QueryException.invalidOperator(getOperator().toString());
}
|
public boolean | isCompoundExpression()
return true;
|
public void | iterateOn(oracle.toplink.essentials.internal.expressions.ExpressionIterator iterator)INTERNAL:
For iterating using an inner class
super.iterateOn(iterator);
if (getFirstChild() != null) {
getFirstChild().iterateOn(iterator);
}
if (getSecondChild() != null) {
getSecondChild().iterateOn(iterator);
}
|
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.
validateNode();
if (getFirstChild() != null) {
//let's make sure a session is available in the case of a parallel expression
ExpressionBuilder builder = getFirstChild().getBuilder();
if (builder != null){
builder.setSession(normalizer.getSession().getRootSession(null));
}
setFirstChild(getFirstChild().normalize(normalizer));
}
if (getSecondChild() != null) {
//let's make sure a session is available in the case of a parallel expression
ExpressionBuilder builder = getSecondChild().getBuilder();
if (builder != null){
builder.setSession(normalizer.getSession().getRootSession(null));
}
setSecondChild(getSecondChild().normalize(normalizer));
}
// For CR2456, it is now possible for normalize to remove redundant
// conditions from the where clause.
if (getFirstChild() == null) {
return getSecondChild();
} else if (getSecondChild() == null) {
return getFirstChild();
}
return this;
|
protected void | postCopyIn(java.util.Dictionary alreadyDone)INTERNAL:
Used for cloning.
super.postCopyIn(alreadyDone);
if (getFirstChild() != null) {
setFirstChild(getFirstChild().copiedVersionFrom(alreadyDone));
}
if (getSecondChild() != null) {
setSecondChild(getSecondChild().copiedVersionFrom(alreadyDone));
}
|
public void | printJava(oracle.toplink.essentials.internal.expressions.ExpressionJavaPrinter printer)INTERNAL:
Print java for project class generation
ExpressionOperator realOperator = getPlatformOperator(printer.getPlatform());
realOperator.printJavaDuo(getFirstChild(), getSecondChild(), printer);
|
public void | printSQL(oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer)INTERNAL:
Print SQL
ExpressionOperator realOperator = getPlatformOperator(printer.getPlatform());
printer.printString("(");
realOperator.printDuo(getFirstChild(), getSecondChild(), printer);
printer.printString(")");
|
public 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
Vector arguments;
Expression first = getFirstChild().rebuildOn(newBase);
if (getSecondChild() == null) {
arguments = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(0);
} else {
arguments = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1);
arguments.addElement(getSecondChild().rebuildOn(newBase));
}
return first.performOperator(getOperator(), arguments);
|
protected void | setFirstChild(oracle.toplink.essentials.expressions.Expression firstChild)
this.firstChild = firstChild;
|
public void | setOperator(oracle.toplink.essentials.expressions.ExpressionOperator newOperator)
operator = newOperator;
|
protected void | setSecondChild(oracle.toplink.essentials.expressions.Expression secondChild)
this.secondChild = secondChild;
|
public oracle.toplink.essentials.expressions.Expression | twistedForBaseAndContext(oracle.toplink.essentials.expressions.Expression newBase, oracle.toplink.essentials.expressions.Expression context)INTRENAL:
Used to change an expression off of one base to an expression off of a different base.
i.e. expression on address to an expression on an employee's address.
Vector arguments;
if (getSecondChild() == null) {
arguments = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(0);
} else {
arguments = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(1);
arguments.addElement(getSecondChild().twistedForBaseAndContext(newBase, context));
}
Expression first = getFirstChild().twistedForBaseAndContext(newBase, context);
return first.performOperator(getOperator(), arguments);
|
public void | validateNode()Do any required validation for this node. Throw an exception if it's incorrect.
Ensure that both sides are not data expressions.
if (getFirstChild() != null) {
if (getFirstChild().isDataExpression() || getFirstChild().isConstantExpression()) {
throw QueryException.invalidExpression(this);
}
}
if (getSecondChild() != null) {
if (getSecondChild().isDataExpression() || getSecondChild().isConstantExpression()) {
throw QueryException.invalidExpression(this);
}
}
|
public void | writeDescriptionOn(java.io.BufferedWriter writer)INTERNAL:
Used to print a debug form of the expression tree.
writer.write(operator.toString());
|
public void | writeSubexpressionsTo(java.io.BufferedWriter writer, int indent)INTERNAL:
Used for toString for debugging only.
if (getFirstChild() != null) {
getFirstChild().toString(writer, indent);
}
if (getSecondChild() != null) {
getSecondChild().toString(writer, indent);
}
|