Methods Summary |
---|
public void | clearAliases()INTERNAL:
super.clearAliases();
aliasedField = null;
|
public java.lang.String | descriptionOfNodeType()INTERNAL:
Used for debug printing.
return "Field";
|
public oracle.toplink.essentials.internal.helper.DatabaseField | getAliasedField()INTERNAL:
Return the field appropriately aliased
if (aliasedField == null) {
initializeAliasedField();
}
return aliasedField;
|
private oracle.toplink.essentials.internal.helper.DatabaseTable | getAliasedTable()Return the alias for our table
DataExpression base = (DataExpression)getBaseExpression();
if (!getField().hasTableName()) {
base.getDescriptor().buildField(getField());
}
DatabaseTable alias = base.aliasForTable(getField().getTable());
if (alias == null) {
return getField().getTable();
} else {
return alias;
}
|
public oracle.toplink.essentials.internal.helper.DatabaseField | getClonedField()INTERNAL:
If there are any fields associated with this expression, return them
return (DatabaseField)getField().clone();
|
public java.util.Vector | getClonedFields()INTERNAL:
If there are any fields associated with this expression, return them
Vector result = new Vector(1);
result.addElement(getField().clone());
return result;
|
public oracle.toplink.essentials.internal.helper.DatabaseField | getField()INTERNAL:
return field;
|
public java.util.Vector | getFields()INTERNAL:
Return all the fields
Vector result = new Vector(1);
result.addElement(getField());
return result;
|
private void | initializeAliasedField()INTERNAL:
Alias the database field for our current environment
DatabaseField tempField = (DatabaseField)getField().clone();
DatabaseTable aliasedTable = getAliasedTable();
// Put in a special check here so that if the aliasing does nothing we don't cache the
// result because it's invalid. This saves us from caching premature data if e.g. debugging
// causes us to print too early"
// if (aliasedTable.equals(getField().getTable())) {
// return;
// } else {
aliasedField = tempField;
aliasedField.setTable(aliasedTable);
// }
|
public boolean | isAttribute()INTERNAL:
return true;
|
public boolean | isFieldExpression()
return true;
|
public void | printJava(oracle.toplink.essentials.internal.expressions.ExpressionJavaPrinter printer)INTERNAL:
Print java for project class generation
getBaseExpression().printJava(printer);
printer.printString(".getField(\"" + getField().getQualifiedName() + "\")");
|
public void | printSQL(oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer)INTERNAL:
Print SQL onto the stream, using the ExpressionPrinter for context
printer.printField(getAliasedField());
|
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
FieldExpression expression = new FieldExpression(getField(), getBaseExpression().rebuildOn(newBase));
expression.setSelectIfOrderedBy(selectIfOrderedBy());
return expression;
|
public void | setField(oracle.toplink.essentials.internal.helper.DatabaseField newField)INTERNAL:
Set the field in the mapping.
field = newField;
|
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"
Expression twistedBase = getBaseExpression().twistedForBaseAndContext(newBase, context);
return twistedBase.getField(getField());
|
public void | validateNode()Do any required validation for this node. Throw an exception if it's incorrect.
DataExpression base = (DataExpression)getBaseExpression();
if (getField().getTable().hasName()) {
Vector tables = base.getOwnedTables();
if ((tables != null) && (!tables.contains((getField().getTable())))) {
throw QueryException.invalidTableForFieldInExpression(getField());
}
}
|
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.
// Joins not supported.
if (getBuilder() != getBaseExpression()) {
throw QueryException.cannotConformExpression();
}
// For bug 2780817 get the mapping directly from the object. In EJB 2.0
// inheritance, each child must override mappings defined in an abstract
// class with its own.
DatabaseMapping mapping = session.getDescriptor(object.getClass()).getObjectBuilder().getMappingForField(getField());
if (mapping == null) {
throw QueryException.cannotConformExpression();
}
return mapping.valueFromObject(object, getField(), session);
|
public void | writeDescriptionOn(java.io.BufferedWriter writer)INTERNAL:
Used to print a debug form of the expression tree.
writer.write(getField().toString());
|
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(...)
DatabaseField field = getField();
if (field != null) {
newFields.addElement(field);
writeField(printer, field, statement);
}
|