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 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, shouldUseOuterJoinForMultitableInheritance
baseExpression, derivedFields, derivedTables, hasBeenNormalized, tableAliases
currentAlias, lastTable, selectIfOrderedBy
Constructor and Description |
---|
QueryKeyExpression() |
QueryKeyExpression(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.
|
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
|
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:
|
Vector |
getFields()
INTERNAL:
Return all the fields
|
Object |
getFieldValue(Object objectValue)
INTERNAL:
Transform the object-level value into a database-level value
|
DatabaseMapping |
getMapping() |
DatabaseMapping |
getMappingFromQueryKey() |
String |
getName()
INTERNAL:
|
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,
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.
|
Object |
valueFromObject(Object object,
AbstractSession session,
AbstractRecord translationRow,
InMemoryQueryIndirectionPolicy valueHolderPolicy,
boolean isObjectUnregistered)
INTERNAL:
Return the value for in memory comparison.
|
Object |
valuesFromCollection(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(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, writeForUpdateOfFields
addDerivedField, 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, writeSubexpressionsTo
addDate, 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, writeFields
protected 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(String aName, Expression base)
public Expression additionalExpressionCriteria()
additionalExpressionCriteria
in class ObjectExpression
public Map additionalExpressionCriteriaMap()
additionalExpressionCriteriaMap
in class ObjectExpression
public DatabaseTable aliasForTable(DatabaseTable table)
aliasForTable
in class DataExpression
public String descriptionOfNodeType()
descriptionOfNodeType
in class Expression
public void doQueryToManyRelationship()
public DatabaseField getAliasedField()
getAliasedField
in class DataExpression
protected DatabaseTable getAliasedTable()
public ClassDescriptor getContainingDescriptor()
public DatabaseField getField()
getField
in class DataExpression
public Vector getFields()
getFields
in class ObjectExpression
public Object getFieldValue(Object objectValue)
getFieldValue
in class Expression
public DatabaseMapping getMapping()
getMapping
in class DataExpression
public DatabaseMapping getMappingFromQueryKey()
public String getName()
Expression
getName
in class Expression
public Vector getOwnedTables()
getOwnedTables
in class ObjectExpression
public QueryKey getQueryKeyOrNull()
getQueryKeyOrNull
in class DataExpression
protected void initializeAliasedField()
public boolean isAttribute()
isAttribute
in class DataExpression
public boolean isQueryKeyExpression()
Expression
isQueryKeyExpression
in class Expression
public Expression mappingCriteria()
mappingCriteria
in class DataExpression
public Expression normalize(ExpressionNormalizer normalizer)
normalize
in class DataExpression
public Expression normalize(ExpressionNormalizer normalizer, Vector 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.
protected void resetCache()
resetCache
in class Expression
public boolean shouldQueryToManyRelationship()
public Expression twistedForBaseAndContext(Expression newBase, Expression context)
twistedForBaseAndContext
in class Expression
public void validateNode()
validateNode
in class Expression
public Object valueFromObject(Object object, AbstractSession session, AbstractRecord translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean isObjectUnregistered)
valueFromObject
in class Expression
public Object valuesFromCollection(Object object, AbstractSession session, InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean isObjectUnregistered)
public void writeDescriptionOn(BufferedWriter writer) throws IOException
writeDescriptionOn
in class Expression
IOException
public boolean isNormalizationRequired()
Copyright © 2023. All rights reserved.