public class TreatAsExpression extends QueryKeyExpression
derivedExpressionsshouldUseUpperCaseForIgnoreCase| Constructor and Description |
|---|
TreatAsExpression(java.lang.Class castClass,
ObjectExpression baseExpression) |
| Modifier and Type | Method and Description |
|---|---|
Expression |
additionalTreatExpressionCriteria()
INTERNAL:
Return the expression to join the main table of this node to any auxiliary tables.
|
java.util.Map |
additionalTreatExpressionCriteriaMap()
INTERNAL:
Used in case outer joins should be printed in FROM clause.
|
DatabaseTable |
aliasForTable(DatabaseTable table)
INTERNAL:
Find the alias for a given table
|
int |
assignTableAliasesStartingAt(int initialValue)
INTERNAL:
Assign aliases to any tables which I own.
|
ClassDescriptor |
convertToCastDescriptor(ClassDescriptor rootDescriptor,
AbstractSession session)
INTERNAL -
Return the descriptor which contains this query key, look in the inheritance hierarchy
of rootDescriptor for the descriptor.
|
Expression |
convertToUseOuterJoin()
INTERNAL:
Modify this expression to use outer joins wherever there are
equality operations between two field nodes.
|
java.lang.String |
descriptionOfNodeType()
INTERNAL:
Used for debug printing.
|
boolean |
equals(java.lang.Object object)
INTERNAL:
Return if the expression is equal to the other.
|
java.util.List<DatabaseTable> |
getAdditionalTables()
INTERNAL:
Return any additional tables that belong to this expression
An example of how this method is used is to return any tables that belong to the map key
when this expression traverses a mapping that uses a Map
|
Expression |
getAlias(Expression subSelect)
ADVANCED: Return an expression representing a sub-select in the from clause.
|
ClassDescriptor |
getDescriptor() |
java.util.Vector |
getFields()
INTERNAL:
Return all the fields
|
java.lang.Object |
getFieldValue(java.lang.Object objectValue,
AbstractSession session)
INTERNAL:
Transform the object-level value into a database-level value
|
ClassDescriptor |
getLeafDescriptor(DatabaseQuery query,
ClassDescriptor rootDescriptor,
AbstractSession session)
INTERNAL:
Lookup the descriptor for this item by traversing its expression recursively.
|
DatabaseMapping |
getLeafMapping(DatabaseQuery query,
ClassDescriptor rootDescriptor,
AbstractSession session)
INTERNAL:
Lookup the mapping for this item by traversing its expression recursively.
|
java.util.List<DatabaseTable> |
getOwnedSubTables()
INTERNAL:
much like getOwnedTables(), this gets the tables represented from the descriptor.
|
java.util.List<DatabaseTable> |
getOwnedTables()
This owns (can access) the child's extra tables as well as its parent's tables
so we should pull these from super (which gets them from the current descriptor)
|
DatabaseTable |
getReferenceTable()
Calculate the reference table for based on the various QueryKeyExpression
usages (join query keys, custom defined query keys, or query keys for
mappings).
|
DatabaseTable |
getRelationTable()
Calculate the relation table for based on the various QueryKeyExpression
usages (join query keys, custom defined query keys, or query keys for
mappings).
|
DatabaseTable |
getSourceTable()
Calculate the source table for based on the various QueryKeyExpression
usages (join query keys, custom defined query keys, or query keys for
mappings).
|
TableAliasLookup |
getTableAliases()
INTERNAL:
Return the aliases used.
|
Expression |
getTreatCriteria()
INTERNAL:
this returns a single expression to represent the join from the main table to all child descriptor tables
Only if outer joins should be printed in the where clause
|
Expression |
getTypeClause() |
boolean |
hasAsOfClause()
ADVANCED:
Answers true if
this is to be queried as of a past time. |
boolean |
isDowncast()
INTERNAL:
|
boolean |
isTreatExpression()
INTERNAL:
|
Expression |
mappingCriteria(Expression base) |
Expression |
normalize(ExpressionNormalizer normalizer,
Expression base,
java.util.List<Expression> 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.
|
void |
printJava(ExpressionJavaPrinter printer)
INTERNAL:
Print java for project class generation
|
void |
printSQL(ExpressionSQLPrinter printer)
INTERNAL:
Print SQL onto the stream, using the ExpressionPrinter for context
|
Expression |
rebuildOn(Expression newBase)
INTERNAL:
This expression is built on a different base than the one we want.
|
boolean |
selectIfOrderedBy()
PUBLIC:
Return whether this expression should be included in the SELECT clause if it is used
in an ORDER BY clause
|
Expression |
twistedForBaseAndContext(Expression newBase,
Expression context,
Expression oldBase)
INTERNAL:
Rebuild myself against the base, with the values of parameters supplied by the context
expression.
|
void |
validateNode()
Do any required validation for this node.
|
java.lang.Object |
valueFromObject(java.lang.Object object,
AbstractSession session,
AbstractRecord translationRow,
int valueHolderPolicy)
INTERNAL:
Return the value for in memory comparison.
|
java.lang.Object |
valueFromObject(java.lang.Object object,
AbstractSession session,
AbstractRecord translationRow,
int valueHolderPolicy,
boolean isObjectUnregistered)
INTERNAL:
Return the value for in memory comparison.
|
void |
writeDescriptionOn(java.io.BufferedWriter writer)
INTERNAL:
Used to print a debug form of the expression tree.
|
void |
writeFields(ExpressionSQLPrinter printer,
java.util.Vector newFields,
SQLSelectStatement statement)
INTERNAL:
called from SQLSelectStatement.writeFieldsFromExpression(...)
|
void |
writeSubexpressionsTo(java.io.BufferedWriter writer,
int indent)
Print the base for debuggin purposes.
|
additionalExpressionCriteria, additionalExpressionCriteriaMap, computeHashCode, doQueryToManyRelationship, getAliasedField, getField, getMapKeyDescriptor, getMapping, getMappingFromQueryKey, getName, getNestedAttributeName, getQueryKeyOrNull, getSelectionFields, index, isAttribute, isDirectCollection, isManyToMany, isMapKeyObjectRelationship, isOneToMany, isOneToOne, isQueryKeyExpression, normalize, rebuildOn, shouldQueryToManyRelationship, treat, valuesFromCollectionaddDerivedExpression, anyOf, anyOfAllowingNone, clearAliases, copyDerivedExpressions, derivedExpressionNamed, derivedManualExpressionNamed, doNotUseOuterJoin, doUseOuterJoin, existingDerivedExpressionNamed, get, getAllowingNull, getCastClass, getFirstNonAggregateExpressionAfterExpressionBuilder, getJoinSource, getManualQueryKey, getOnClause, getOuterJoinExpIndex, hasBeenAliased, isDowncast, isObjectExpression, isTreatUsed, isUsingOuterJoinForMultitableInheritance, join, leftJoin, newDerivedExpressionNamed, newManualDerivedExpressionNamed, postCopyIn, setCastClass, setJoinSource, setOnClause, setOuterJoinExpIndex, setShouldUseOuterJoinForMultitableInheritance, shouldUseOuterJoin, shouldUseOuterJoinForMultitableInheritance, typeaddDerivedField, addDerivedTable, asOf, copyCollection, existingDerivedField, existingDerivedTable, getAsOfClause, getContainingDescriptor, getField, getField, getTable, getTable, hasBeenNormalized, isDataExpression, iterateOn, newDerivedField, newDerivedTable, setHasBeenNormalized, setTableAliases, tableAliasesDescriptiongetBaseExpression, getBuilder, resetPlaceHolderBuilder, setBaseExpression, shallowCloneaddDate, 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, anyOfAllowingNone, as, as, ascending, asciiValue, 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, 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, getAsOfClauseRecursively, getClonedField, getFunction, getFunction, getFunction, getFunction, getFunction, getFunctionWithArguments, getFunctionWithArguments, getNumberVal, getOperator, getOperator, getParameter, getParameter, getParameter, getProperty, 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, indexOf, intersect, intersect, intersectAll, intersectAll, isClassTypeExpression, isCompoundExpression, isConstantExpression, isEmpty, isExpressionBuilder, isFieldExpression, isFragment, isFunctionExpression, isLiteralExpression, isLogicalExpression, isMapEntryExpression, isNull, isParameterExpression, isRelationExpression, isSubSelectExpression, isTableExpression, isValueExpression, lastDay, 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, replace, replicate, replicate, reverse, right, right, rightPad, rightPad, rightTrim, rightTrim, roundDate, 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, trim, trim, truncateDate, twist, union, union, unionAll, unionAll, value, value, value, value, value, value, value, value, value, value, variancepublic TreatAsExpression(java.lang.Class castClass,
ObjectExpression baseExpression)
public Expression convertToUseOuterJoin()
ExpressionconvertToUseOuterJoin in class Expressionpublic java.lang.String descriptionOfNodeType()
QueryKeyExpressiondescriptionOfNodeType in class QueryKeyExpressionpublic boolean equals(java.lang.Object object)
QueryKeyExpressionequals in class QueryKeyExpressionpublic java.util.Vector getFields()
QueryKeyExpressiongetFields in class QueryKeyExpressionpublic java.lang.Object getFieldValue(java.lang.Object objectValue,
AbstractSession session)
QueryKeyExpressiongetFieldValue in class QueryKeyExpressionpublic java.util.List<DatabaseTable> getOwnedTables()
getOwnedTables in class QueryKeyExpressionpublic Expression getAlias(Expression subSelect)
DataExpressionExample:
builder.getAlias(builder.subQuery(reportQuery)).get("type").equal("S");
getAlias in class DataExpressionpublic DatabaseTable getRelationTable()
SQLSelectStatement.appendFromClauseForOuterJoin(org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter, java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable>, java.util.Collection, boolean).getRelationTable in class QueryKeyExpressionpublic TableAliasLookup getTableAliases()
DataExpressiongetTableAliases in class DataExpressionpublic boolean hasAsOfClause()
Expressionthis is to be queried as of a past time.hasAsOfClause in class DataExpressionasOf(null); hasAsOfClause().Expression.getAsOfClause()public boolean isDowncast()
public boolean isTreatExpression()
isTreatExpression in class Expressionpublic void printSQL(ExpressionSQLPrinter printer)
QueryKeyExpressionprintSQL in class QueryKeyExpressionpublic boolean selectIfOrderedBy()
ExpressionselectIfOrderedBy in class Expressionpublic Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)
QueryKeyExpressiontwistedForBaseAndContext in class QueryKeyExpressionpublic void validateNode()
QueryKeyExpressionvalidateNode in class QueryKeyExpressionpublic java.lang.Object valueFromObject(java.lang.Object object,
AbstractSession session,
AbstractRecord translationRow,
int valueHolderPolicy,
boolean isObjectUnregistered)
QueryKeyExpressionvalueFromObject in class QueryKeyExpressionisObjectUnregistered - true if object possibly not a clone, but is being
conformed against the unit of work cache.public java.lang.Object valueFromObject(java.lang.Object object,
AbstractSession session,
AbstractRecord translationRow,
int valueHolderPolicy)
ExpressionvalueFromObject in class Expressionpublic void writeDescriptionOn(java.io.BufferedWriter writer)
throws java.io.IOException
QueryKeyExpressionwriteDescriptionOn in class QueryKeyExpressionjava.io.IOExceptionpublic void writeFields(ExpressionSQLPrinter printer, java.util.Vector newFields, SQLSelectStatement statement)
ExpressionwriteFields in class Expressionpublic void writeSubexpressionsTo(java.io.BufferedWriter writer,
int indent)
throws java.io.IOException
DataExpressionwriteSubexpressionsTo in class DataExpressionjava.io.IOExceptionpublic ClassDescriptor getLeafDescriptor(DatabaseQuery query, ClassDescriptor rootDescriptor, AbstractSession session)
QueryKeyExpressiongetLeafDescriptor in class QueryKeyExpressionpublic DatabaseMapping getLeafMapping(DatabaseQuery query, ClassDescriptor rootDescriptor, AbstractSession session)
QueryKeyExpressiongetLeafMapping in class QueryKeyExpressionpublic DatabaseTable aliasForTable(DatabaseTable table)
QueryKeyExpressionaliasForTable in class QueryKeyExpressionpublic Expression rebuildOn(Expression newBase)
rebuildOn in class QueryKeyExpressionExpression.cloneUsing(Expression newBase)public ClassDescriptor getDescriptor()
getDescriptor in class ObjectExpressionpublic ClassDescriptor convertToCastDescriptor(ClassDescriptor rootDescriptor, AbstractSession session)
convertToCastDescriptor in class ObjectExpressionpublic Expression getTypeClause()
public void printJava(ExpressionJavaPrinter printer)
printJava in class QueryKeyExpressionpublic int assignTableAliasesStartingAt(int initialValue)
assignTableAliasesStartingAt in class ObjectExpressionpublic java.util.List<DatabaseTable> getOwnedSubTables()
public java.util.List<DatabaseTable> getAdditionalTables()
QueryKeyExpressiongetAdditionalTables in class QueryKeyExpressionpublic Expression mappingCriteria(Expression base)
mappingCriteria in class QueryKeyExpressionpublic java.util.Map additionalTreatExpressionCriteriaMap()
public Expression getTreatCriteria()
public Expression additionalTreatExpressionCriteria()
public DatabaseTable getSourceTable()
QueryKeyExpressionSQLSelectStatement.appendFromClauseForOuterJoin(org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter, java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable>, java.util.Collection, boolean).getSourceTable in class QueryKeyExpressionpublic DatabaseTable getReferenceTable()
QueryKeyExpressionSQLSelectStatement.appendFromClauseForOuterJoin(org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter, java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable>, java.util.Collection, boolean).getReferenceTable in class QueryKeyExpressionpublic Expression normalize(ExpressionNormalizer normalizer, Expression base, java.util.List<Expression> foreignKeyJoinPointer)
QueryKeyExpressionnormalize in class QueryKeyExpressionEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference