Top Description Fields Constructors Methods
org.eclipse.persistence.internal.expressions

public Class FieldExpression

extends DataExpression
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.expressions.IndexExpression
Imports
java.io.BufferedWriter, .IOException, java.util.Collection, .List, .Vector, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.exceptions.ConversionException, .QueryException, org.eclipse.persistence.expressions.Expression, org.eclipse.persistence.internal.helper.DatabaseField, .DatabaseTable, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, org.eclipse.persistence.mappings.DatabaseMapping

Field expressions represent a field of a table. Their base is either a table or object expression. This is used for mapping queries and to allow queries on non-mapped field or tables.

Field Summary

Modifier and TypeField and Description
protected transient DatabaseField
protected DatabaseField
Inherited from org.eclipse.persistence.internal.expressions.DataExpression:
asOfClausederivedFieldsderivedTableshasBeenNormalizedtableAliases

Constructor Summary

AccessConstructor and Description
public
FieldExpression()

FieldExpression constructor comment.

public
FieldExpression(DatabaseField newField)

FieldExpression constructor comment.

public
FieldExpression(DatabaseField newField, Expression myBase)

FieldExpression constructor comment.

Method Summary

Modifier and TypeMethod and Description
public void
public int
computeHashCode()

Overrides org.eclipse.persistence.expressions.Expression.computeHashCode.

INTERNAL: Compute a consistent hash-code for the expression.
public String
public boolean
equals(Object
the reference object with which to compare.
object
)

Overrides org.eclipse.persistence.internal.expressions.DataExpression.equals.

INTERNAL: Return if the expression is equal to the other.
public DatabaseField
getAliasedField()

Overrides org.eclipse.persistence.internal.expressions.DataExpression.getAliasedField.

INTERNAL: Return the field appropriately aliased
private DatabaseTable
getAliasedTable()

Return the alias for our table

public DatabaseField
getClonedField()

Overrides org.eclipse.persistence.expressions.Expression.getClonedField.

INTERNAL: If there are any fields associated with this expression, return them
public Vector<E>
getClonedFields()

INTERNAL: If there are any fields associated with this expression, return them

public DatabaseField
public Vector<E>
getFields()

Overrides org.eclipse.persistence.expressions.Expression.getFields.

INTERNAL: Return all the fields
public Object
getFieldValue(Object value, AbstractSession session)

Overrides org.eclipse.persistence.expressions.Expression.getFieldValue.

INTERNAL: Provide for conversion of the passed object's value, based on the referenced field value.
private void
initializeAliasedField()

INTERNAL: Alias the database field for our current environment

public boolean
public boolean
public Expression
normalize(ExpressionNormalizer normalizer)

Overrides org.eclipse.persistence.internal.expressions.DataExpression.normalize.

INTERNAL: Normalize the expression into a printable structure.
public void
printJava(ExpressionJavaPrinter printer)

Overrides org.eclipse.persistence.expressions.Expression.printJava.

INTERNAL: Print java for project class generation
public void
printSQL(ExpressionSQLPrinter printer)

Overrides org.eclipse.persistence.internal.expressions.DataExpression.printSQL.

INTERNAL: Print SQL onto the stream, using the ExpressionPrinter for context
public Expression
rebuildOn(Expression newBase)

Implements abstract org.eclipse.persistence.expressions.Expression.rebuildOn.

INTERNAL: This expression is built on a different base than the one we want.
public void
setField(DatabaseField newField)

INTERNAL: Set the field in the mapping.

public Expression
twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)

Overrides org.eclipse.persistence.expressions.Expression.twistedForBaseAndContext.

INTERNAL: Rebuild myself against the base, with the values of parameters supplied by the context expression.
public void
validateNode()

Overrides org.eclipse.persistence.expressions.Expression.validateNode.

Do any required validation for this node.
public Object
valueFromObject(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean
true if object possibly not a clone, but is being conformed against the unit of work cache.
isObjectUnregistered
)

Overrides org.eclipse.persistence.expressions.Expression.valueFromObject.

INTERNAL: Return the value for in memory comparison.
public void
writeDescriptionOn(BufferedWriter writer)

Overrides org.eclipse.persistence.expressions.Expression.writeDescriptionOn.

INTERNAL: Used to print a debug form of the expression tree.
protected void
writeField(ExpressionSQLPrinter printer, DatabaseField field, SQLSelectStatement statement)

Overrides org.eclipse.persistence.expressions.Expression.writeField.

INTERNAL: Append the field name to the writer.
public void
writeFields(ExpressionSQLPrinter printer, List<DatabaseField> newFields, SQLSelectStatement statement)

Overrides org.eclipse.persistence.expressions.Expression.writeFields.

INTERNAL: called from SQLSelectStatement.writeFieldsFromExpression(...)
protected void
writeForUpdateOf(ExpressionSQLPrinter printer, SQLSelectStatement statement)

INTERNAL: writes the field for fine-grained pessimistic locking.

Inherited from org.eclipse.persistence.internal.expressions.DataExpression:
addDerivedFieldaddDerivedTablealiasForTableasOfassignAliasassignAliascopyCollectionexistingDerivedFieldexistingDerivedTablegetAliasgetAsOfClausegetContainingDescriptorgetDescriptorgetFieldgetFieldgetMappinggetQueryKeyOrNullgetTablegetTablegetTableAliaseshasAsOfClausehasBeenAliasedhasBeenNormalizedhasDerivedFieldshasDerivedTablesisDataExpressioniterateOnnewDerivedFieldnewDerivedTablepostCopyInsetHasBeenNormalizedsetTableAliasestableAliasesDescriptionwriteSubexpressionsTo

Field Detail

aliasedFieldback to summary
protected transient DatabaseField aliasedField
fieldback to summary
protected DatabaseField field

Constructor Detail

FieldExpressionback to summary
public FieldExpression()

FieldExpression constructor comment.

FieldExpressionback to summary
public FieldExpression(DatabaseField newField)

FieldExpression constructor comment.

FieldExpressionback to summary
public FieldExpression(DatabaseField newField, Expression myBase)

FieldExpression constructor comment.

Method Detail

clearAliasesback to summary
public void clearAliases()

Overrides org.eclipse.persistence.internal.expressions.DataExpression.clearAliases.

INTERNAL:

Annotations
@Override
computeHashCodeback to summary
public int computeHashCode()

Overrides org.eclipse.persistence.expressions.Expression.computeHashCode.

INTERNAL: Compute a consistent hash-code for the expression. This is used to allow dynamic expression's SQL to be cached.

Annotations
@Override
descriptionOfNodeTypeback to summary
public String descriptionOfNodeType()

Overrides org.eclipse.persistence.expressions.Expression.descriptionOfNodeType.

INTERNAL: Used for debug printing.

Annotations
@Override
equalsback to summary
public boolean equals(Object object)

Overrides org.eclipse.persistence.internal.expressions.DataExpression.equals.

INTERNAL: Return if the expression is equal to the other. This is used to allow dynamic expression's SQL to be cached. This must be over written by each subclass.

Parameters
object:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAliasedFieldback to summary
public DatabaseField getAliasedField()

Overrides org.eclipse.persistence.internal.expressions.DataExpression.getAliasedField.

INTERNAL: Return the field appropriately aliased

Annotations
@Override
getAliasedTableback to summary
private DatabaseTable getAliasedTable()

Return the alias for our table

getClonedFieldback to summary
public DatabaseField getClonedField()

Overrides org.eclipse.persistence.expressions.Expression.getClonedField.

INTERNAL: If there are any fields associated with this expression, return them

Annotations
@Override
getClonedFieldsback to summary
public Vector<E> getClonedFields()

INTERNAL: If there are any fields associated with this expression, return them

getFieldback to summary
public DatabaseField getField()

Overrides org.eclipse.persistence.internal.expressions.DataExpression.getField.

INTERNAL:

Annotations
@Override
getFieldsback to summary
public Vector<E> getFields()

Overrides org.eclipse.persistence.expressions.Expression.getFields.

INTERNAL: Return all the fields

Annotations
@Override
getFieldValueback to summary
public Object getFieldValue(Object value, AbstractSession session)

Overrides org.eclipse.persistence.expressions.Expression.getFieldValue.

INTERNAL: Provide for conversion of the passed object's value, based on the referenced field value.

Annotations
@Override
initializeAliasedFieldback to summary
private void initializeAliasedField()

INTERNAL: Alias the database field for our current environment

isAttributeback to summary
public boolean isAttribute()

Overrides org.eclipse.persistence.internal.expressions.DataExpression.isAttribute.

INTERNAL:

Annotations
@Override
isFieldExpressionback to summary
public boolean isFieldExpression()

Overrides org.eclipse.persistence.expressions.Expression.isFieldExpression.

Doc from org.eclipse.persistence.expressions.Expression.isFieldExpression.

INTERNAL:

Annotations
@Override
normalizeback to summary
public Expression normalize(ExpressionNormalizer normalizer)

Overrides org.eclipse.persistence.internal.expressions.DataExpression.normalize.

INTERNAL: Normalize the expression into a printable structure.

Annotations
@Override
printJavaback to summary
public void printJava(ExpressionJavaPrinter printer)

Overrides org.eclipse.persistence.expressions.Expression.printJava.

INTERNAL: Print java for project class generation

Annotations
@Override
printSQLback to summary
public void printSQL(ExpressionSQLPrinter printer)

Overrides org.eclipse.persistence.internal.expressions.DataExpression.printSQL.

INTERNAL: Print SQL onto the stream, using the ExpressionPrinter for context

Annotations
@Override
rebuildOnback to summary
public Expression rebuildOn(Expression newBase)

Implements abstract org.eclipse.persistence.expressions.Expression.rebuildOn.

INTERNAL: This expression is built on a different base than the one we want. Rebuild it and return the root of the new tree

Annotations
@Override
setFieldback to summary
public void setField(DatabaseField newField)

INTERNAL: Set the field in the mapping.

twistedForBaseAndContextback to summary
public Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)

Overrides org.eclipse.persistence.expressions.Expression.twistedForBaseAndContext.

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"

Annotations
@Override
validateNodeback to summary
public void validateNode()

Overrides org.eclipse.persistence.expressions.Expression.validateNode.

Do any required validation for this node. Throw an exception if it's incorrect.

Annotations
@Override
valueFromObjectback to summary
public Object valueFromObject(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered)

Overrides org.eclipse.persistence.expressions.Expression.valueFromObject.

INTERNAL: Return the value for in memory comparison. This is only valid for valueable expressions.

Parameters
isObjectUnregistered:boolean

Doc from org.eclipse.persistence.expressions.Expression.valueFromObject.

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

Annotations
@Override
writeDescriptionOnback to summary
public void writeDescriptionOn(BufferedWriter writer) throws IOException

Overrides org.eclipse.persistence.expressions.Expression.writeDescriptionOn.

INTERNAL: Used to print a debug form of the expression tree.

Annotations
@Override
writeFieldback to summary
protected void writeField(ExpressionSQLPrinter printer, DatabaseField field, SQLSelectStatement statement)

Overrides org.eclipse.persistence.expressions.Expression.writeField.

Doc from org.eclipse.persistence.expressions.Expression.writeField.

INTERNAL: Append the field name to the writer. Should be overridden for special operators such as functions.

Annotations
@Override
writeFieldsback to summary
public void writeFields(ExpressionSQLPrinter printer, List<DatabaseField> newFields, SQLSelectStatement statement)

Overrides org.eclipse.persistence.expressions.Expression.writeFields.

INTERNAL: called from SQLSelectStatement.writeFieldsFromExpression(...)

Annotations
@Override
writeForUpdateOfback to summary
protected void writeForUpdateOf(ExpressionSQLPrinter printer, SQLSelectStatement statement)

INTERNAL: writes the field for fine-grained pessimistic locking.