Class ClassTypeExpression
- 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.ClassTypeExpression
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class ClassTypeExpression extends DataExpression
- Author:
- cdelahun
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DatabaseField
aliasedField
Cache the aliased field.protected DatabaseField
field
Cache the aliased field.-
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 ClassTypeExpression()
ClassTypeExpression(Expression base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
descriptionOfNodeType()
INTERNAL: Used for debug printing.DatabaseField
getAliasedField()
INTERNAL: Return the field appropriately aliasedprotected DatabaseTable
getAliasedTable()
Return the alias for our tableClassDescriptor
getContainingDescriptor()
INTERNAL: Like QueryKeyExpression, return the descriptor for the class type used, null if one can't be determined yet.ClassDescriptor
getContainingDescriptor(ObjectLevelReadQuery query)
INTERNAL: Return the descriptor for the base expression.DatabaseField
getField()
INTERNAL:Vector
getFields()
INTERNAL: Return all the fieldsObject
getFieldValue(Object objectValue, AbstractSession session)
INTERNAL: Transform the object-level value into a database-level value objectValue is a Class or collection of Class objects and the returned value is the database representation Example: ObjectValue=LargeProject returns "L".protected void
initializeAliasedField()
INTERNAL: Alias the database field for our current environmentboolean
isAttribute()
INTERNAL:boolean
isClassTypeExpression()
INTERNAL:Expression
normalize(ExpressionNormalizer normalizer, Vector foreignKeyJoinPointer)
INTERNAL: For CR#2456 if this is part of an objExp.equal(objExp), do not need to add additional expressions to normalizer both times, and the foreign key join replaces the equal expression.Expression
rebuildOn(Expression newBase)
INTERNAL: This expression is built on a different base than the one we want.Expression
twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)
INTERNAL: Rebuild myself against the base, with the values of parameters supplied by the context expression.Object
typeValueFromObject(Object object, AbstractSession session)
INTERNAL This method returns the inheritance field value for an object to conform in an in-memory query.void
validateNode()
INTERNAL: Do any required validation for this node.Object
valueFromObject(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered)
INTERNAL: Return the value for in memory comparison.void
writeDescriptionOn(BufferedWriter writer)
INTERNAL: Used to print a debug form of the expression tree.-
Methods inherited from class org.eclipse.persistence.internal.expressions.DataExpression
addDerivedField, addDerivedTable, aliasForTable, asOf, assignAlias, assignAlias, clearAliases, copyCollection, equals, existingDerivedField, existingDerivedTable, getAlias, getAsOfClause, getDescriptor, getField, getField, getMapping, getQueryKeyOrNull, getTable, getTable, getTableAliases, hasAsOfClause, hasBeenAliased, hasBeenNormalized, hasDerivedFields, hasDerivedTables, isDataExpression, iterateOn, newDerivedField, newDerivedTable, normalize, postCopyIn, printSQL, 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, allOf, and, any, any, any, any, any, any, any, any, any, any, any, any, anyOf, anyOf, anyOfAllowingNone, anyOfAllowingNone, as, ascending, asciiValue, assignTableAliasesStartingAt, average, between, between, between, between, between, between, between, between, between, caseConditionStatement, caseConditionStatement, caseStatement, caseStatement, cast, clone, cloneUsing, coalesce, coalesce, computeHashCode, 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, getClonedField, getFunction, getFunction, getFunction, getFunction, 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, isCompoundExpression, isConstantExpression, isEmpty, isExpressionBuilder, isFieldExpression, 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, printJava, 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, 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, writeField, writeFields
-
-
-
-
Field Detail
-
field
protected DatabaseField field
Cache the aliased field. Only applies to attributes.
-
aliasedField
protected DatabaseField aliasedField
Cache the aliased field. Only applies to attributes.
-
-
Constructor Detail
-
ClassTypeExpression
public ClassTypeExpression(Expression base)
-
ClassTypeExpression
public ClassTypeExpression()
-
-
Method Detail
-
descriptionOfNodeType
public String descriptionOfNodeType()
INTERNAL: Used for debug printing.- Overrides:
descriptionOfNodeType
in classExpression
-
rebuildOn
public Expression rebuildOn(Expression newBase)
Description copied from class:Expression
INTERNAL: This expression is built on a different base than the one we want. Rebuild it and return the root of the new tree If receiver is a complex expression, use cloneUsing(newBase) instead.- Specified by:
rebuildOn
in classExpression
- See Also:
Expression.cloneUsing(Expression newBase)
-
typeValueFromObject
public Object typeValueFromObject(Object object, AbstractSession session)
INTERNAL This method returns the inheritance field value for an object to conform in an in-memory query. Similar to getFieldValue, but deals with an instance rather than a Class object directly
-
validateNode
public void validateNode()
Description copied from class:Expression
INTERNAL: Do any required validation for this node. Throw an exception for any incorrect constructs.- Overrides:
validateNode
in classExpression
-
valueFromObject
public Object valueFromObject(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered)
INTERNAL: Return the value for in memory comparison. This is only valid for value expressions. Pulled from QueryKeyExpression valueFromObject- Overrides:
valueFromObject
in classExpression
isObjectUnregistered
- true if object possibly not a clone, but is being conformed against the unit of work cache.
-
writeDescriptionOn
public void writeDescriptionOn(BufferedWriter writer) throws IOException
INTERNAL: Used to print a debug form of the expression tree.- Overrides:
writeDescriptionOn
in classExpression
- Throws:
IOException
-
getField
public DatabaseField getField()
INTERNAL:- Overrides:
getField
in classDataExpression
-
getFieldValue
public Object getFieldValue(Object objectValue, AbstractSession session)
INTERNAL: Transform the object-level value into a database-level value objectValue is a Class or collection of Class objects and the returned value is the database representation Example: ObjectValue=LargeProject returns "L".- Overrides:
getFieldValue
in classExpression
-
getContainingDescriptor
public ClassDescriptor getContainingDescriptor()
INTERNAL: Like QueryKeyExpression, return the descriptor for the class type used, null if one can't be determined yet. Should only be called when a session is already set.- Overrides:
getContainingDescriptor
in classDataExpression
-
getContainingDescriptor
public ClassDescriptor getContainingDescriptor(ObjectLevelReadQuery query)
INTERNAL: Return the descriptor for the base expression. This is used in ReportItem when building the return value (a class), as none of the expressions will have a session.
-
isClassTypeExpression
public boolean isClassTypeExpression()
Description copied from class:Expression
INTERNAL:- Overrides:
isClassTypeExpression
in classExpression
-
isAttribute
public boolean isAttribute()
INTERNAL:- Overrides:
isAttribute
in classDataExpression
-
normalize
public Expression normalize(ExpressionNormalizer normalizer, Vector foreignKeyJoinPointer)
INTERNAL: For CR#2456 if this is part of an objExp.equal(objExp), do not need to add additional expressions to normalizer both times, and the foreign key join replaces the equal expression.
-
initializeAliasedField
protected void initializeAliasedField()
INTERNAL: Alias the database field for our current environment
-
getAliasedField
public DatabaseField getAliasedField()
INTERNAL: Return the field appropriately aliased- Overrides:
getAliasedField
in classDataExpression
-
getAliasedTable
protected DatabaseTable getAliasedTable()
Return the alias for our table
-
getFields
public Vector getFields()
INTERNAL: Return all the fields- Overrides:
getFields
in classExpression
-
twistedForBaseAndContext
public Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)
Description copied from class:Expression
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:
twistedForBaseAndContext
in classExpression
-
-