Class FieldExpression
- java.lang.Object
-
- org.eclipse.persistence.expressions.Expression
-
- org.eclipse.persistence.internal.expressions.BaseExpression
-
- org.eclipse.persistence.internal.expressions.DataExpression
-
- org.eclipse.persistence.internal.expressions.FieldExpression
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
IndexExpression
public class FieldExpression extends DataExpression
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.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DatabaseFieldaliasedFieldprotected DatabaseFieldfield-
Fields inherited from class org.eclipse.persistence.internal.expressions.DataExpression
asOfClause, derivedFields, derivedTables, hasBeenNormalized, tableAliases
-
Fields inherited from class org.eclipse.persistence.internal.expressions.BaseExpression
baseExpression, builder
-
Fields inherited from class org.eclipse.persistence.expressions.Expression
currentAlias, hashCode, lastTable, selectIfOrderedBy, shouldUseUpperCaseForIgnoreCase
-
-
Constructor Summary
Constructors Constructor Description FieldExpression()FieldExpression constructor comment.FieldExpression(DatabaseField newField)FieldExpression constructor comment.FieldExpression(DatabaseField newField, Expression myBase)FieldExpression constructor comment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAliases()INTERNAL:intcomputeHashCode()INTERNAL: Compute a consistent hash-code for the expression.java.lang.StringdescriptionOfNodeType()INTERNAL: Used for debug printing.booleanequals(java.lang.Object object)INTERNAL: Return if the expression is equal to the other.DatabaseFieldgetAliasedField()INTERNAL: Return the field appropriately aliasedDatabaseFieldgetClonedField()INTERNAL: If there are any fields associated with this expression, return themjava.util.VectorgetClonedFields()INTERNAL: If there are any fields associated with this expression, return themDatabaseFieldgetField()INTERNAL:java.util.VectorgetFields()INTERNAL: Return all the fieldsjava.lang.ObjectgetFieldValue(java.lang.Object value, AbstractSession session)INTERNAL: Provide for conversion of the passed object's value, based on the referenced field value.booleanisAttribute()INTERNAL:booleanisFieldExpression()INTERNAL:Expressionnormalize(ExpressionNormalizer normalizer)INTERNAL: Normalize the expression into a printable structure.voidprintJava(ExpressionJavaPrinter printer)INTERNAL: Print java for project class generationvoidprintSQL(ExpressionSQLPrinter printer)INTERNAL: Print SQL onto the stream, using the ExpressionPrinter for contextExpressionrebuildOn(Expression newBase)INTERNAL: This expression is built on a different base than the one we want.voidsetField(DatabaseField newField)INTERNAL: Set the field in the mapping.ExpressiontwistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)INTERNAL: Rebuild myself against the base, with the values of parameters supplied by the context expression.voidvalidateNode()Do any required validation for this node.java.lang.ObjectvalueFromObject(java.lang.Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered)INTERNAL: Return the value for in memory comparison.voidwriteDescriptionOn(java.io.BufferedWriter writer)INTERNAL: Used to print a debug form of the expression tree.protected voidwriteField(ExpressionSQLPrinter printer, DatabaseField field, SQLSelectStatement statement)INTERNAL: Append the field name to the writer.voidwriteFields(ExpressionSQLPrinter printer, java.util.Vector newFields, SQLSelectStatement statement)INTERNAL: called from SQLSelectStatement.writeFieldsFromExpression(...)protected voidwriteForUpdateOf(ExpressionSQLPrinter printer, SQLSelectStatement statement)INTERNAL: writes the field for fine-grained pessimistic locking.-
Methods inherited from class org.eclipse.persistence.internal.expressions.DataExpression
addDerivedField, addDerivedTable, aliasForTable, asOf, assignAlias, assignAlias, copyCollection, existingDerivedField, existingDerivedTable, getAlias, getAsOfClause, getContainingDescriptor, getDescriptor, getField, getField, getMapping, getQueryKeyOrNull, getTable, getTable, getTableAliases, hasAsOfClause, hasBeenAliased, hasBeenNormalized, hasDerivedFields, hasDerivedTables, isDataExpression, iterateOn, newDerivedField, newDerivedTable, postCopyIn, setHasBeenNormalized, setTableAliases, tableAliasesDescription, writeSubexpressionsTo
-
Methods inherited from class org.eclipse.persistence.internal.expressions.BaseExpression
getBaseExpression, getBuilder, resetPlaceHolderBuilder, setBaseExpression, shallowClone
-
Methods inherited from class org.eclipse.persistence.expressions.Expression
addDate, addDate, addMonths, addMonths, alias, all, all, all, all, all, all, all, all, all, all, all, all, all, allOf, and, any, any, any, any, any, any, any, any, any, any, any, any, any, anyOf, anyOf, anyOfAllowingNone, anyOfAllowingNone, as, as, ascending, asciiValue, assignTableAliasesStartingAt, average, between, between, between, between, between, between, between, between, between, caseConditionStatement, caseConditionStatement, caseStatement, caseStatement, cast, clone, cloneUsing, coalesce, coalesce, concat, containsAllKeyWords, containsAnyKeyWords, containsSubstring, containsSubstring, containsSubstringIgnoringCase, containsSubstringIgnoringCase, convertNodeToUseOuterJoin, convertToUseOuterJoin, copiedVersionFrom, count, create, create, createWithBaseLast, currentDate, currentDateDate, currentTime, currentTimeStamp, dateDifference, dateDifference, dateName, datePart, dateToString, decode, descending, difference, distinct, doesConform, doesConform, equal, equal, equal, equal, equal, equal, equal, equal, equal, equal, equalOuterJoin, equalOuterJoin, equalsIgnoreCase, equalsIgnoreCase, except, except, exceptAll, exceptAll, exists, existsNode, extract, extractFields, extractPrimaryKeyValues, extractValue, extractValues, extractXml, from, fromConstant, fromLiteral, get, get, getAllowingNull, getAsOfClauseRecursively, getFunction, getFunction, getFunction, getFunction, getFunction, getFunctionWithArguments, getFunctionWithArguments, getLeafDescriptor, getLeafMapping, getName, getNumberVal, getOperator, getOperator, getOwnedTables, getParameter, getParameter, getParameter, getProperty, getSelectionFields, getSelectionFields, getSession, getStringVal, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, hashCode, hexToRaw, ifNull, in, in, in, in, in, in, in, in, in, in, in, in, index, indexOf, intersect, intersect, intersectAll, intersectAll, isClassTypeExpression, isCompoundExpression, isConstantExpression, isEmpty, isExpressionBuilder, isFragment, isFunctionExpression, isLiteralExpression, isLogicalExpression, isMapEntryExpression, isNull, isObjectExpression, isParameterExpression, isQueryKeyExpression, isRelationExpression, isSubSelectExpression, isTableExpression, isTreatExpression, isValueExpression, join, lastDay, leftJoin, leftPad, leftPad, leftTrim, leftTrim, length, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, like, like, like, like, likeIgnoreCase, likeIgnoreCase, literal, locate, locate, locate, mapEntry, mapKey, maximum, minimum, monthsBetween, newTime, nextDay, noneOf, not, notBetween, notBetween, notBetween, notBetween, notBetween, notBetween, notBetween, notBetween, notBetween, notEmpty, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notExists, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notIn, notLike, notLike, notLike, notLike, notNull, nullIf, nullsFirst, nullsLast, operator, or, performOperator, postfixSQL, prefixSQL, ref, regexp, regexp, registerIn, replace, replicate, replicate, resetCache, reverse, right, right, rightPad, rightPad, rightTrim, rightTrim, roundDate, selectIfOrderedBy, setLocalBase, setSelectIfOrderedBy, size, size, some, some, some, some, some, some, some, some, some, some, some, some, some, sql, standardDeviation, subQuery, substring, substring, substring, substring, sum, toChar, toChar, toCharacter, toDate, toLowerCase, toNumber, toString, toString, toUpperCase, toUppercaseCasedWords, translate, treat, trim, trim, truncateDate, twist, type, union, union, unionAll, unionAll, value, value, value, value, value, value, value, value, value, value, valueFromObject, variance, writeAlias
-
-
-
-
Field Detail
-
field
protected DatabaseField field
-
aliasedField
protected transient DatabaseField aliasedField
-
-
Constructor Detail
-
FieldExpression
public FieldExpression()
FieldExpression constructor comment.
-
FieldExpression
public FieldExpression(DatabaseField newField)
FieldExpression constructor comment.
-
FieldExpression
public FieldExpression(DatabaseField newField, Expression myBase)
FieldExpression constructor comment.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object object)
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.- Overrides:
equalsin classDataExpression
-
computeHashCode
public int computeHashCode()
INTERNAL: Compute a consistent hash-code for the expression. This is used to allow dynamic expression's SQL to be cached.- Overrides:
computeHashCodein classExpression
-
clearAliases
public void clearAliases()
INTERNAL:- Overrides:
clearAliasesin classDataExpression
-
descriptionOfNodeType
public java.lang.String descriptionOfNodeType()
INTERNAL: Used for debug printing.- Overrides:
descriptionOfNodeTypein classExpression
-
getAliasedField
public DatabaseField getAliasedField()
INTERNAL: Return the field appropriately aliased- Overrides:
getAliasedFieldin classDataExpression
-
getClonedField
public DatabaseField getClonedField()
INTERNAL: If there are any fields associated with this expression, return them- Overrides:
getClonedFieldin classExpression
-
getClonedFields
public java.util.Vector getClonedFields()
INTERNAL: If there are any fields associated with this expression, return them
-
getField
public DatabaseField getField()
INTERNAL:- Overrides:
getFieldin classDataExpression
-
getFields
public java.util.Vector getFields()
INTERNAL: Return all the fields- Overrides:
getFieldsin classExpression
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.Object value, AbstractSession session)INTERNAL: Provide for conversion of the passed object's value, based on the referenced field value.- Overrides:
getFieldValuein classExpression
-
isAttribute
public boolean isAttribute()
INTERNAL:- Overrides:
isAttributein classDataExpression
-
isFieldExpression
public boolean isFieldExpression()
Description copied from class:ExpressionINTERNAL:- Overrides:
isFieldExpressionin classExpression
-
normalize
public Expression normalize(ExpressionNormalizer normalizer)
INTERNAL: Normalize the expression into a printable structure.- Overrides:
normalizein classDataExpression
-
printSQL
public void printSQL(ExpressionSQLPrinter printer)
INTERNAL: Print SQL onto the stream, using the ExpressionPrinter for context- Overrides:
printSQLin classDataExpression
-
printJava
public void printJava(ExpressionJavaPrinter printer)
INTERNAL: Print java for project class generation- Overrides:
printJavain classExpression
-
rebuildOn
public Expression rebuildOn(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- Specified by:
rebuildOnin classExpression- See Also:
Expression.cloneUsing(Expression newBase)
-
setField
public void setField(DatabaseField newField)
INTERNAL: Set the field in the mapping.
-
twistedForBaseAndContext
public Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)
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"- Overrides:
twistedForBaseAndContextin classExpression
-
validateNode
public void validateNode()
Do any required validation for this node. Throw an exception if it's incorrect.- Overrides:
validateNodein classExpression
-
valueFromObject
public java.lang.Object valueFromObject(java.lang.Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered)INTERNAL: Return the value for in memory comparison. This is only valid for valueable expressions.- Overrides:
valueFromObjectin classExpressionisObjectUnregistered- true if object possibly not a clone, but is being conformed against the unit of work cache.
-
writeDescriptionOn
public void writeDescriptionOn(java.io.BufferedWriter writer) throws java.io.IOExceptionINTERNAL: Used to print a debug form of the expression tree.- Overrides:
writeDescriptionOnin classExpression- Throws:
java.io.IOException
-
writeFields
public void writeFields(ExpressionSQLPrinter printer, java.util.Vector newFields, SQLSelectStatement statement)
INTERNAL: called from SQLSelectStatement.writeFieldsFromExpression(...)- Overrides:
writeFieldsin classExpression
-
writeField
protected void writeField(ExpressionSQLPrinter printer, DatabaseField field, SQLSelectStatement statement)
Description copied from class:ExpressionINTERNAL: Append the field name to the writer. Should be overridden for special operators such as functions.- Overrides:
writeFieldin classExpression
-
writeForUpdateOf
protected void writeForUpdateOf(ExpressionSQLPrinter printer, SQLSelectStatement statement)
INTERNAL: writes the field for fine-grained pessimistic locking.
-
-