public class QueryKeyExpression extends ObjectExpression
derivedExpressions
shouldUseUpperCaseForIgnoreCase
Constructor and Description |
---|
QueryKeyExpression() |
QueryKeyExpression(java.lang.String aName,
Expression base) |
Modifier and Type | Method and Description |
---|---|
Expression |
additionalExpressionCriteria()
INTERNAL:
Return the expression to join the main table of this node to any auxiliary tables.
|
java.util.Map |
additionalExpressionCriteriaMap()
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 |
computeHashCode()
INTERNAL:
Compute a consistent hash-code for the expression.
|
java.lang.String |
descriptionOfNodeType()
INTERNAL:
Used for debug printing.
|
void |
doQueryToManyRelationship()
INTERNAL:
|
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
|
DatabaseField |
getAliasedField()
INTERNAL:
Return the field appropriately aliased
|
DatabaseField |
getField()
INTERNAL:
|
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.
|
ClassDescriptor |
getMapKeyDescriptor()
INTERNAL:
Return if descriptor for the map key mapping where the key is a OneToOne.
|
DatabaseMapping |
getMapping() |
DatabaseMapping |
getMappingFromQueryKey() |
java.lang.String |
getName()
INTERNAL:
|
java.lang.String |
getNestedAttributeName()
INTERNAL:
Returns nested attribute name or null
|
java.util.List<DatabaseTable> |
getOwnedTables()
INTERNAL:
|
QueryKey |
getQueryKeyOrNull() |
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).
|
java.util.List<DatabaseField> |
getSelectionFields(ReadQuery query)
INTERNAL:
|
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).
|
Expression |
index() |
boolean |
isAttribute()
INTERNAL:
Return if the expression is for a direct mapped attribute.
|
boolean |
isDirectCollection()
INTERNAL:
Indicates whether this expression corresponds to DirectCollection.
|
boolean |
isManyToMany()
INTERNAL:
Indicates whether this expression corresponds to ManyToMany.
|
boolean |
isMapKeyObjectRelationship()
INTERNAL:
Return if the expression if for a map key mapping where the key is a OneToOne.
|
boolean |
isOneToMany()
INTERNAL:
Indicates whether this expression corresponds to OneToMany.
|
boolean |
isOneToOne()
INTERNAL:
Indicates whether this expression corresponds to OneToOne.
|
boolean |
isQueryKeyExpression()
INTERNAL:
|
Expression |
mappingCriteria(Expression base) |
Expression |
normalize(ExpressionNormalizer normalizer)
INTERNAL:
Normalize the expression into a printable structure.
|
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.
|
Expression |
rebuildOn(Expression oldBase,
Expression newBase)
INTERNAL:
A special version of rebuildOn where the newBase need not be a new
ExpressionBuilder but any expression.
|
boolean |
shouldQueryToManyRelationship() |
Expression |
treat(java.lang.Class castClass)
ADVANCED:
Return an expression that allows you to treat its base as if it were a subclass of the class returned by the base
This can only be called on an ExpressionBuilder, the result of expression.get(String), expression.getAllowingNull(String),
the result of expression.anyOf("String") or the result of expression.anyOfAllowingNull("String")
downcast uses Expression.type() internally to guarantee the results are of the specified class.
|
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,
boolean isObjectUnregistered)
INTERNAL:
Return the value for in memory comparison.
|
java.lang.Object |
valuesFromCollection(java.lang.Object object,
AbstractSession session,
int valueHolderPolicy,
boolean isObjectUnregistered)
INTERNAL
This method iterates through a collection and gets the values from the objects to conform in an in-memory query.
|
void |
writeDescriptionOn(java.io.BufferedWriter writer)
INTERNAL:
Used to print a debug form of the expression tree.
|
addDerivedExpression, anyOf, anyOfAllowingNone, assignTableAliasesStartingAt, clearAliases, convertToCastDescriptor, copyDerivedExpressions, derivedExpressionNamed, derivedManualExpressionNamed, doNotUseOuterJoin, doUseOuterJoin, existingDerivedExpressionNamed, get, getAllowingNull, getCastClass, getDescriptor, 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, getAlias, getAsOfClause, getContainingDescriptor, getField, getField, getTable, getTable, getTableAliases, hasAsOfClause, hasBeenNormalized, isDataExpression, iterateOn, newDerivedField, newDerivedTable, setHasBeenNormalized, setTableAliases, tableAliasesDescription, writeSubexpressionsTo
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, 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, 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, isTreatExpression, 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, 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, trim, trim, truncateDate, twist, union, union, unionAll, unionAll, value, value, value, value, value, value, value, value, value, value, valueFromObject, variance, writeFields
public QueryKeyExpression()
public QueryKeyExpression(java.lang.String aName, Expression base)
public boolean equals(java.lang.Object object)
equals
in class ObjectExpression
public int computeHashCode()
computeHashCode
in class Expression
public Expression additionalExpressionCriteria()
additionalExpressionCriteria
in class ObjectExpression
public java.util.Map additionalExpressionCriteriaMap()
additionalExpressionCriteriaMap
in class ObjectExpression
public DatabaseTable aliasForTable(DatabaseTable table)
aliasForTable
in class DataExpression
public Expression treat(java.lang.Class castClass)
Example:
EclipseLink: employee.get("project").treat(LargeProject.class).get("budget").equal(1000) Java: ((LargeProject)employee.getProjects().get(0)).getBudget() == 1000 SQL: LPROJ.PROJ_ID (+)= PROJ.PROJ_ID AND L_PROJ.BUDGET = 1000 AND PROJ.TYPE = "L"
treat
in class ObjectExpression
public java.lang.String descriptionOfNodeType()
descriptionOfNodeType
in class Expression
public void doQueryToManyRelationship()
public java.util.List<DatabaseTable> getAdditionalTables()
getAdditionalTables
in class ObjectExpression
public DatabaseField getAliasedField()
getAliasedField
in class DataExpression
public DatabaseField getField()
getField
in class DataExpression
public java.util.Vector getFields()
getFields
in class ObjectExpression
public java.util.List<DatabaseField> getSelectionFields(ReadQuery query)
getSelectionFields
in class ObjectExpression
public java.lang.Object getFieldValue(java.lang.Object objectValue, AbstractSession session)
getFieldValue
in class Expression
public DatabaseMapping getMapping()
getMapping
in class DataExpression
public DatabaseMapping getMappingFromQueryKey()
public java.lang.String getName()
Expression
getName
in class Expression
public java.lang.String getNestedAttributeName()
public java.util.List<DatabaseTable> getOwnedTables()
getOwnedTables
in class ObjectExpression
public QueryKey getQueryKeyOrNull()
getQueryKeyOrNull
in class DataExpression
public Expression index()
index
in class Expression
public boolean isAttribute()
isAttribute
in class DataExpression
public boolean isQueryKeyExpression()
Expression
isQueryKeyExpression
in class Expression
public Expression mappingCriteria(Expression base)
public Expression normalize(ExpressionNormalizer normalizer)
normalize
in class DataExpression
public Expression normalize(ExpressionNormalizer normalizer, Expression base, java.util.List<Expression> foreignKeyJoinPointer)
public void printSQL(ExpressionSQLPrinter printer)
printSQL
in class DataExpression
public void printJava(ExpressionJavaPrinter printer)
printJava
in class Expression
public Expression rebuildOn(Expression newBase)
rebuildOn
in class Expression
Expression.cloneUsing(Expression newBase)
public Expression rebuildOn(Expression oldBase, Expression newBase)
For nested joined attributes, the joined attribute query must have its joined attributes rebuilt relative to it.
public boolean shouldQueryToManyRelationship()
public Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)
twistedForBaseAndContext
in class Expression
public void validateNode()
validateNode
in class Expression
public java.lang.Object valueFromObject(java.lang.Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered)
valueFromObject
in class Expression
isObjectUnregistered
- true if object possibly not a clone, but is being
conformed against the unit of work cache.public java.lang.Object valuesFromCollection(java.lang.Object object, AbstractSession session, int valueHolderPolicy, boolean isObjectUnregistered)
public ClassDescriptor getLeafDescriptor(DatabaseQuery query, ClassDescriptor rootDescriptor, AbstractSession session)
getLeafDescriptor
in class Expression
public DatabaseMapping getLeafMapping(DatabaseQuery query, ClassDescriptor rootDescriptor, AbstractSession session)
getLeafMapping
in class Expression
public void writeDescriptionOn(java.io.BufferedWriter writer) throws java.io.IOException
writeDescriptionOn
in class Expression
java.io.IOException
public boolean isDirectCollection()
isDirectCollection
in class ObjectExpression
public boolean isOneToOne()
public boolean isOneToMany()
public boolean isManyToMany()
public boolean isMapKeyObjectRelationship()
public ClassDescriptor getMapKeyDescriptor()
public DatabaseTable getReferenceTable()
SQLSelectStatement.appendFromClauseForOuterJoin(org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter, java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable>, java.util.Collection, boolean)
.public DatabaseTable getSourceTable()
SQLSelectStatement.appendFromClauseForOuterJoin(org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter, java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable>, java.util.Collection, boolean)
.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 ObjectExpression
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference