Methods Summary |
---|
public java.lang.String | descriptionOfNodeType()INTERNAL:
Used for debug printing.
return "Constant";
|
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)
return getLocalBase().getBuilder();
|
protected oracle.toplink.essentials.expressions.Expression | getLocalBase()
return localBase;
|
public java.lang.Object | getValue()
return value;
|
public boolean | isConstantExpression()
return true;
|
public boolean | isValueExpression()INTERNAL:
return true;
|
protected void | postCopyIn(java.util.Dictionary alreadyDone)INTERNAL:
Used for cloning.
super.postCopyIn(alreadyDone);
localBase = localBase.copiedVersionFrom(alreadyDone);
|
public void | printJava(oracle.toplink.essentials.internal.expressions.ExpressionJavaPrinter printer)INTERNAL:
Print java for project class generation
printer.printJava(getValue());
|
public void | printSQL(oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer)INTERNAL:
Print SQL onto the stream, using the ExpressionPrinter for context
Object value = getLocalBase().getFieldValue(getValue());
if(value == null) {
printer.printNull(this);
} else {
printer.printPrimitive(value);
}
|
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.
printer.printPrimitive(getValue());
|
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
Expression result = (ConstantExpression)clone();
result.setLocalBase(getLocalBase().rebuildOn(newBase));
return result;
|
public void | setLocalBase(oracle.toplink.essentials.expressions.Expression e)
localBase = e;
|
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"
return (Expression)this.clone();
|
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.
return getLocalBase().getFieldValue(getValue());
|
public void | writeDescriptionOn(java.io.BufferedWriter writer)INTERNAL:
Used to print a debug form of the expression tree.
writer.write(String.valueOf(getValue()));
|
public void | writeFields(oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer, java.util.Vector newFields, oracle.toplink.essentials.internal.expressions.SQLSelectStatement statement)INTERNAL:
Append the constant value into the printer
//print ", " before each selected field except the first one
if (printer.isFirstElementPrinted()) {
printer.printString(", ");
} else {
printer.setIsFirstElementPrinted(true);
}
// This field is a constant value, so any name can be used.
newFields.addElement(new DatabaseField("*"));
printSQL(printer);
|