public class TreatAsExpression extends QueryKeyExpression
derivedExpressions
shouldUseUpperCaseForIgnoreCase
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, valuesFromCollection
addDerivedExpression, 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, type
addDerivedField, addDerivedTable, asOf, copyCollection, existingDerivedField, existingDerivedTable, getAsOfClause, getContainingDescriptor, getField, getField, getTable, getTable, hasBeenNormalized, isDataExpression, iterateOn, newDerivedField, newDerivedTable, setHasBeenNormalized, setTableAliases, tableAliasesDescription
getBaseExpression, getBuilder, resetPlaceHolderBuilder, setBaseExpression, shallowClone
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, 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, variance
public TreatAsExpression(java.lang.Class castClass, ObjectExpression baseExpression)
public Expression convertToUseOuterJoin()
Expression
convertToUseOuterJoin
in class Expression
public java.lang.String descriptionOfNodeType()
QueryKeyExpression
descriptionOfNodeType
in class QueryKeyExpression
public boolean equals(java.lang.Object object)
QueryKeyExpression
equals
in class QueryKeyExpression
public java.util.Vector getFields()
QueryKeyExpression
getFields
in class QueryKeyExpression
public java.lang.Object getFieldValue(java.lang.Object objectValue, AbstractSession session)
QueryKeyExpression
getFieldValue
in class QueryKeyExpression
public java.util.List<DatabaseTable> getOwnedTables()
getOwnedTables
in class QueryKeyExpression
public Expression getAlias(Expression subSelect)
DataExpression
Example:
builder.getAlias(builder.subQuery(reportQuery)).get("type").equal("S");
getAlias
in class DataExpression
public 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 QueryKeyExpression
public TableAliasLookup getTableAliases()
DataExpression
getTableAliases
in class DataExpression
public boolean hasAsOfClause()
Expression
this
is to be queried as of a past time.hasAsOfClause
in class DataExpression
asOf(null); hasAsOfClause()
.Expression.getAsOfClause()
public boolean isDowncast()
public boolean isTreatExpression()
isTreatExpression
in class Expression
public void printSQL(ExpressionSQLPrinter printer)
QueryKeyExpression
printSQL
in class QueryKeyExpression
public boolean selectIfOrderedBy()
Expression
selectIfOrderedBy
in class Expression
public Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)
QueryKeyExpression
twistedForBaseAndContext
in class QueryKeyExpression
public void validateNode()
QueryKeyExpression
validateNode
in class QueryKeyExpression
public java.lang.Object valueFromObject(java.lang.Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered)
QueryKeyExpression
valueFromObject
in class QueryKeyExpression
isObjectUnregistered
- 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)
Expression
valueFromObject
in class Expression
public void writeDescriptionOn(java.io.BufferedWriter writer) throws java.io.IOException
QueryKeyExpression
writeDescriptionOn
in class QueryKeyExpression
java.io.IOException
public void writeFields(ExpressionSQLPrinter printer, java.util.Vector newFields, SQLSelectStatement statement)
Expression
writeFields
in class Expression
public void writeSubexpressionsTo(java.io.BufferedWriter writer, int indent) throws java.io.IOException
DataExpression
writeSubexpressionsTo
in class DataExpression
java.io.IOException
public ClassDescriptor getLeafDescriptor(DatabaseQuery query, ClassDescriptor rootDescriptor, AbstractSession session)
QueryKeyExpression
getLeafDescriptor
in class QueryKeyExpression
public DatabaseMapping getLeafMapping(DatabaseQuery query, ClassDescriptor rootDescriptor, AbstractSession session)
QueryKeyExpression
getLeafMapping
in class QueryKeyExpression
public DatabaseTable aliasForTable(DatabaseTable table)
QueryKeyExpression
aliasForTable
in class QueryKeyExpression
public Expression rebuildOn(Expression newBase)
rebuildOn
in class QueryKeyExpression
Expression.cloneUsing(Expression newBase)
public ClassDescriptor getDescriptor()
getDescriptor
in class ObjectExpression
public ClassDescriptor convertToCastDescriptor(ClassDescriptor rootDescriptor, AbstractSession session)
convertToCastDescriptor
in class ObjectExpression
public Expression getTypeClause()
public void printJava(ExpressionJavaPrinter printer)
printJava
in class QueryKeyExpression
public int assignTableAliasesStartingAt(int initialValue)
assignTableAliasesStartingAt
in class ObjectExpression
public java.util.List<DatabaseTable> getOwnedSubTables()
public java.util.List<DatabaseTable> getAdditionalTables()
QueryKeyExpression
getAdditionalTables
in class QueryKeyExpression
public Expression mappingCriteria(Expression base)
mappingCriteria
in class QueryKeyExpression
public java.util.Map additionalTreatExpressionCriteriaMap()
public Expression getTreatCriteria()
public Expression additionalTreatExpressionCriteria()
public DatabaseTable getSourceTable()
QueryKeyExpression
SQLSelectStatement.appendFromClauseForOuterJoin(org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter, java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable>, java.util.Collection, boolean)
.getSourceTable
in class QueryKeyExpression
public DatabaseTable getReferenceTable()
QueryKeyExpression
SQLSelectStatement.appendFromClauseForOuterJoin(org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter, java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable>, java.util.Collection, boolean)
.getReferenceTable
in class QueryKeyExpression
public Expression normalize(ExpressionNormalizer normalizer, Expression base, java.util.List<Expression> foreignKeyJoinPointer)
QueryKeyExpression
normalize
in class QueryKeyExpression
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference