public class QueryKeyExpression extends ObjectExpression
| Modifier and Type | Field and Description |
|---|---|
protected DatabaseField |
aliasedField
Cache the aliased field.
|
protected boolean |
hasMapping |
protected boolean |
hasQueryKey |
protected DatabaseMapping |
mapping
Same for mappings.
|
protected java.lang.String |
name
The name of the query key.
|
protected QueryKey |
queryKey
Cache the query key for performance.
|
protected boolean |
shouldQueryToManyRelationship
Is this a query across a 1:many or many:many relationship.
|
derivedExpressions, descriptor, shouldUseOuterJoin, shouldUseOuterJoinForMultitableInheritancebaseExpression, derivedFields, derivedTables, hasBeenNormalized, tableAliasescurrentAlias, lastTable, selectIfOrderedBy| 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
|
java.lang.String |
descriptionOfNodeType()
INTERNAL:
Used for debug printing.
|
void |
doQueryToManyRelationship()
INTERNAL:
|
DatabaseField |
getAliasedField()
INTERNAL:
Return the field appropriately aliased
|
protected DatabaseTable |
getAliasedTable()
Return the alias for our table
|
ClassDescriptor |
getContainingDescriptor()
INTERNAL:
Return the descriptor which contains this query key.
|
DatabaseField |
getField()
INTERNAL:
|
java.util.Vector |
getFields()
INTERNAL:
Return all the fields
|
java.lang.Object |
getFieldValue(java.lang.Object objectValue)
INTERNAL:
Transform the object-level value into a database-level value
|
DatabaseMapping |
getMapping() |
DatabaseMapping |
getMappingFromQueryKey() |
java.lang.String |
getName()
INTERNAL:
|
java.util.Vector |
getOwnedTables()
INTERNAL:
|
QueryKey |
getQueryKeyOrNull() |
protected void |
initializeAliasedField()
INTERNAL:
Alias the database field for our current environment
|
boolean |
isAttribute()
INTERNAL:
|
boolean |
isNormalizationRequired()
INTERNAL:
Indicates that RelationExpression.normalize method shouldn't attempt
optimize normalization by not normalizing this.
|
boolean |
isQueryKeyExpression()
INTERNAL:
|
Expression |
mappingCriteria() |
Expression |
normalize(ExpressionNormalizer normalizer)
INTERNAL:
Normalize the expression into a printable structure.
|
Expression |
normalize(ExpressionNormalizer normalizer,
java.util.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.
|
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.
|
protected void |
resetCache()
Reset cached information here so that we can be sure we're accurate.
|
boolean |
shouldQueryToManyRelationship() |
Expression |
twistedForBaseAndContext(Expression newBase,
Expression context)
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,
InMemoryQueryIndirectionPolicy valueHolderPolicy,
boolean isObjectUnregistered)
INTERNAL:
Return the value for in memory comparison.
|
java.lang.Object |
valuesFromCollection(java.lang.Object object,
AbstractSession session,
InMemoryQueryIndirectionPolicy 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, derivedExpressionNamed, derivedManualExpressionNamed, doNotUseOuterJoin, doUseOuterJoin, existingDerivedExpressionNamed, get, getAllowingNull, getDescriptor, getForUpdateOfFields, getManualQueryKey, hasDerivedExpressions, isObjectExpression, isUsingOuterJoinForMultitableInheritance, newDerivedExpressionNamed, newManualDerivedExpressionNamed, postCopyIn, postCopyIn, setShouldUseOuterJoinForMultitableInheritance, shouldUseOuterJoin, shouldUseOuterJoinForMultitableInheritance, writeForUpdateOfFieldsaddDerivedField, addDerivedTable, assignAlias, assignAlias, clearAliases, copyCollection, existingDerivedField, existingDerivedTable, getBaseExpression, getBuilder, getField, getField, getTable, getTable, getTableAliases, hasBeenAliased, hasBeenNormalized, hasDerivedFields, hasDerivedTables, isDataExpression, iterateOn, newDerivedField, newDerivedTable, setBaseExpression, setHasBeenNormalized, setTableAliases, tableAliasesDescription, writeSubexpressionsToaddDate, addDate, addMonths, addMonths, 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, anyOfAllowingNone, ascending, asciiValue, assignTableAliasesStartingAt, average, between, between, between, between, between, between, between, between, between, caseStatement, clone, cloneUsing, 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, detectExpression, difference, distinct, doesConform, doesConform, equal, equal, equal, equal, equal, equal, equal, equal, equal, equal, equalOuterJoin, equalOuterJoin, equalsIgnoreCase, equalsIgnoreCase, exists, existsNode, extract, extractPrimaryKeyValues, extractValue, from, fromConstant, fromLiteral, get, getAllowingNull, getClonedField, getFunction, getFunction, getFunction, getFunction, getFunctionWithArguments, getNumberVal, getOperator, getOperator, getParameter, getParameter, getParameter, getSession, getStringVal, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, hasAsOfClause, hexToRaw, ifNull, in, in, in, in, in, in, in, in, in, in, in, in, indexOf, isCompoundExpression, isConstantExpression, isEmpty, isExpressionBuilder, isFieldExpression, isFragment, isFunctionExpression, isLiteralExpression, isLogicalExpression, isNull, isParameterExpression, isRelationExpression, 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, 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, notNull, or, performOperator, postfixSQL, prefixSQL, printSQLWithoutConversion, ref, registerIn, replace, replicate, replicate, reverse, right, right, rightPad, rightPad, rightTrim, rightTrim, roundDate, selectIfOrderedBy, setLocalBase, setSelectIfOrderedBy, shallowClone, size, some, some, some, some, some, some, some, some, some, some, some, some, standardDeviation, subQuery, substring, substring, sum, toChar, toChar, toCharacter, toDate, toLowerCase, toNumber, toString, toString, toUpperCase, toUppercaseCasedWords, translate, trim, trim, truncateDate, twist, value, value, value, value, value, value, value, value, value, value, valueFromObject, variance, writeField, writeFieldsprotected java.lang.String name
protected DatabaseField aliasedField
protected boolean shouldQueryToManyRelationship
protected transient QueryKey queryKey
protected boolean hasQueryKey
protected transient DatabaseMapping mapping
protected boolean hasMapping
public QueryKeyExpression()
public QueryKeyExpression(java.lang.String aName,
Expression base)
public Expression additionalExpressionCriteria()
additionalExpressionCriteria in class ObjectExpressionpublic java.util.Map additionalExpressionCriteriaMap()
additionalExpressionCriteriaMap in class ObjectExpressionpublic DatabaseTable aliasForTable(DatabaseTable table)
aliasForTable in class DataExpressionpublic java.lang.String descriptionOfNodeType()
descriptionOfNodeType in class Expressionpublic void doQueryToManyRelationship()
public DatabaseField getAliasedField()
getAliasedField in class DataExpressionprotected DatabaseTable getAliasedTable()
public ClassDescriptor getContainingDescriptor()
public DatabaseField getField()
getField in class DataExpressionpublic java.util.Vector getFields()
getFields in class ObjectExpressionpublic java.lang.Object getFieldValue(java.lang.Object objectValue)
getFieldValue in class Expressionpublic DatabaseMapping getMapping()
getMapping in class DataExpressionpublic DatabaseMapping getMappingFromQueryKey()
public java.lang.String getName()
ExpressiongetName in class Expressionpublic java.util.Vector getOwnedTables()
getOwnedTables in class ObjectExpressionpublic QueryKey getQueryKeyOrNull()
getQueryKeyOrNull in class DataExpressionprotected void initializeAliasedField()
public boolean isAttribute()
isAttribute in class DataExpressionpublic boolean isQueryKeyExpression()
ExpressionisQueryKeyExpression in class Expressionpublic Expression mappingCriteria()
mappingCriteria in class DataExpressionpublic Expression normalize(ExpressionNormalizer normalizer)
normalize in class DataExpressionpublic Expression normalize(ExpressionNormalizer normalizer, java.util.Vector foreignKeyJoinPointer)
public void printSQL(ExpressionSQLPrinter printer)
printSQL in class DataExpressionpublic void printJava(ExpressionJavaPrinter printer)
printJava in class Expressionpublic Expression rebuildOn(Expression newBase)
rebuildOn in class ExpressionExpression.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.
protected void resetCache()
resetCache in class Expressionpublic boolean shouldQueryToManyRelationship()
public Expression twistedForBaseAndContext(Expression newBase, Expression context)
twistedForBaseAndContext in class Expressionpublic void validateNode()
validateNode in class Expressionpublic java.lang.Object valueFromObject(java.lang.Object object,
AbstractSession session,
AbstractRecord translationRow,
InMemoryQueryIndirectionPolicy valueHolderPolicy,
boolean isObjectUnregistered)
valueFromObject in class Expressionpublic java.lang.Object valuesFromCollection(java.lang.Object object,
AbstractSession session,
InMemoryQueryIndirectionPolicy valueHolderPolicy,
boolean isObjectUnregistered)
public void writeDescriptionOn(java.io.BufferedWriter writer)
throws java.io.IOException
writeDescriptionOn in class Expressionjava.io.IOExceptionpublic boolean isNormalizationRequired()