public abstract class ObjectExpression extends DataExpression
Modifier and Type | Field and Description |
---|---|
java.util.List<Expression> |
derivedExpressions |
shouldUseUpperCaseForIgnoreCase
Constructor and Description |
---|
ObjectExpression() |
Modifier and Type | Method and Description |
---|---|
void |
addDerivedExpression(Expression addThis)
INTERNAL:
Add the expression as a derived child of this expression.
|
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.
|
Expression |
anyOf(java.lang.String attributeName,
boolean shouldJoinBeIndependent)
PUBLIC:
Return an expression representing traversal of a 1:many or many:many relationship.
|
Expression |
anyOfAllowingNone(java.lang.String attributeName,
boolean shouldJoinBeIndependent)
ADVANCED:
Return an expression representing traversal of a 1:many or many:many relationship.
|
int |
assignTableAliasesStartingAt(int initialValue)
INTERNAL:
Assign aliases to any tables which I own.
|
void |
clearAliases()
INTERNAL:
|
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.
|
java.util.List<Expression> |
copyDerivedExpressions(java.util.Map alreadyDone) |
QueryKeyExpression |
derivedExpressionNamed(java.lang.String attributeName) |
Expression |
derivedManualExpressionNamed(java.lang.String attributeName,
ClassDescriptor aDescriptor) |
void |
doNotUseOuterJoin() |
void |
doUseOuterJoin() |
boolean |
equals(java.lang.Object expression)
INTERNAL:
Return if the expression is equal to the other.
|
QueryKeyExpression |
existingDerivedExpressionNamed(java.lang.String attributeName) |
Expression |
get(java.lang.String attributeName,
boolean forceInnerJoin)
Return the expression from the attribute dervied from this expression.
|
java.util.List<DatabaseTable> |
getAdditionalTables()
Return any tables in addition to the descriptor's tables, such as the mappings join table.
|
Expression |
getAllowingNull(java.lang.String attributeName)
ADVANCED:
Return an expression that wraps the attribute or query key name.
|
java.lang.Class |
getCastClass() |
ClassDescriptor |
getDescriptor() |
java.util.Vector |
getFields()
INTERNAL: Not to be confused with the public getField(String)
This returns a collection of all fields associated with this object.
|
ObjectExpression |
getFirstNonAggregateExpressionAfterExpressionBuilder(java.util.List aggregateMappingsEncountered)
INTERNAL:
Parses an expression to return the first non-AggregateObjectMapping expression after the base ExpressionBuilder.
|
Expression |
getJoinSource() |
Expression |
getManualQueryKey(java.lang.String attributeName,
ClassDescriptor aDescriptor) |
Expression |
getOnClause() |
java.lang.Integer |
getOuterJoinExpIndex() |
java.util.List<DatabaseTable> |
getOwnedTables()
Return any tables that are defined by this expression (and not its base).
|
DatabaseTable |
getRelationTable()
Return null by default, only QueryKeyExpression can have a relation table.
|
java.util.List<DatabaseField> |
getSelectionFields(ReadQuery query)
INTERNAL:
|
boolean |
hasBeenAliased()
INTERNAL:
Answers if the database tables associated with this expression have been
aliased.
|
boolean |
isDirectCollection()
Return false by default, only possible for QueryKeyExpression.
|
boolean |
isDowncast(ClassDescriptor rootDescriptor,
AbstractSession session)
INTERNAL
Return true if it uses a cast class and query is downcasting.
|
boolean |
isObjectExpression()
INTERNAL:
|
boolean |
isTreatUsed()
INTERNAL
Return true if treat was used on this expression
|
boolean |
isUsingOuterJoinForMultitableInheritance()
INTERNAL:
indicates whether additional expressions for multitable inheritance should be used and are available
|
Expression |
join(Expression target,
Expression onClause)
Defines a join between this expression and the target expression based on the ON clause.
|
Expression |
leftJoin(Expression target,
Expression onClause)
Defines a join between this expression and the target expression based on the ON clause.
|
QueryKeyExpression |
newDerivedExpressionNamed(java.lang.String attributeName) |
Expression |
newManualDerivedExpressionNamed(java.lang.String attributeName,
ClassDescriptor aDescriptor) |
void |
postCopyIn(java.util.Map alreadyDone,
java.util.List<Expression> oldDerivedFields,
java.util.List<Expression> oldDerivedTables)
INTERNAL:
The method was added to circumvent derivedFields and derivedTables being
protected.
|
void |
setCastClass(java.lang.Class castClass) |
void |
setJoinSource(Expression joinSource) |
void |
setOnClause(Expression onClause) |
void |
setOuterJoinExpIndex(java.lang.Integer outerJoinExpIndex) |
void |
setShouldUseOuterJoinForMultitableInheritance(boolean shouldUseOuterJoinForMultitableInheritance)
INTERNAL:
set the flag indicating whether subclasses should be joined
|
boolean |
shouldUseOuterJoin() |
boolean |
shouldUseOuterJoinForMultitableInheritance() |
Expression |
treat(java.lang.Class castClass)
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 |
type()
PUBLIC:
Return an expression that wraps the inheritance type field in an expression.
|
addDerivedField, addDerivedTable, aliasForTable, asOf, copyCollection, existingDerivedField, existingDerivedTable, getAlias, getAliasedField, getAsOfClause, getContainingDescriptor, getField, getField, getField, getMapping, getQueryKeyOrNull, getTable, getTable, getTableAliases, hasAsOfClause, hasBeenNormalized, isAttribute, isDataExpression, iterateOn, newDerivedField, newDerivedTable, normalize, printSQL, 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, computeHashCode, concat, containsAllKeyWords, containsAnyKeyWords, containsSubstring, containsSubstring, containsSubstringIgnoringCase, containsSubstringIgnoringCase, convertToUseOuterJoin, copiedVersionFrom, count, create, create, createWithBaseLast, currentDate, currentDateDate, currentTime, currentTimeStamp, dateDifference, dateDifference, dateName, datePart, dateToString, decode, descending, descriptionOfNodeType, 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, getFieldValue, getFunction, getFunction, getFunction, getFunction, getFunction, getFunctionWithArguments, getFunctionWithArguments, getLeafDescriptor, getLeafMapping, getName, 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, index, indexOf, intersect, intersect, intersectAll, intersectAll, isClassTypeExpression, isCompoundExpression, isConstantExpression, isEmpty, isExpressionBuilder, isFieldExpression, isFragment, isFunctionExpression, isLiteralExpression, isLogicalExpression, isMapEntryExpression, isNull, isParameterExpression, isQueryKeyExpression, 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, printJava, rebuildOn, 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, twistedForBaseAndContext, union, union, unionAll, unionAll, validateNode, value, value, value, value, value, value, value, value, value, value, valueFromObject, valueFromObject, variance, writeDescriptionOn, writeFields
public java.util.List<Expression> derivedExpressions
public Expression treat(java.lang.Class castClass)
Example:
Expression: employee.get("project").as(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 Expression
public boolean equals(java.lang.Object expression)
equals
in class DataExpression
public void addDerivedExpression(Expression addThis)
public Expression additionalExpressionCriteria()
public java.util.Map additionalExpressionCriteriaMap()
public int assignTableAliasesStartingAt(int initialValue)
assignTableAliasesStartingAt
in class Expression
public Expression anyOf(java.lang.String attributeName, boolean shouldJoinBeIndependent)
Example:
Expression: employee.anyOf("managedEmployees").get("firstName").equal("Bob") Java: no direct equivalent SQL: SELECT DISTINCT ... WHERE (t2.MGR_ID = t1.ID) AND (t2.F_NAME = 'Bob')
anyOf
in class Expression
shouldJoinBeIndependent
- indicates whether a new expression should be created.public Expression anyOfAllowingNone(java.lang.String attributeName, boolean shouldJoinBeIndependent)
Example:
Expression: employee.anyOf("managedEmployees").get("firstName").equal("Bob") Java: no direct equivalent SQL: SELECT DISTINCT ... WHERE (t2.MGR_ID (+) = t1.ID) AND (t2.F_NAME = 'Bob')
anyOfAllowingNone
in class Expression
shouldJoinBeIndependent
- indicates whether a new expression should be created.public boolean isDowncast(ClassDescriptor rootDescriptor, AbstractSession session)
public boolean isTreatUsed()
public ClassDescriptor convertToCastDescriptor(ClassDescriptor rootDescriptor, AbstractSession session)
public java.util.List<Expression> copyDerivedExpressions(java.util.Map alreadyDone)
public QueryKeyExpression derivedExpressionNamed(java.lang.String attributeName)
public Expression derivedManualExpressionNamed(java.lang.String attributeName, ClassDescriptor aDescriptor)
public void doNotUseOuterJoin()
public void doUseOuterJoin()
public QueryKeyExpression existingDerivedExpressionNamed(java.lang.String attributeName)
public Expression get(java.lang.String attributeName, boolean forceInnerJoin)
get
in class Expression
forceInnerJoin
- - allows the get to not force an inner-join (if getAllowingNull was used elsewhere).public Expression leftJoin(Expression target, Expression onClause)
leftJoin
in class Expression
public Expression join(Expression target, Expression onClause)
join
in class Expression
public Expression getAllowingNull(java.lang.String attributeName)
Expression
Example:
builder.getAllowingNull("address").get("city").equal("Ottawa");
getAllowingNull
in class Expression
public java.lang.Class getCastClass()
public Expression type()
Example:
builder.getClassForInheritance().equal(SmallProject.class);
type
in class Expression
public ClassDescriptor getDescriptor()
getDescriptor
in class DataExpression
public java.util.Vector getFields()
getFields
in class Expression
public java.util.List<DatabaseField> getSelectionFields(ReadQuery query)
getSelectionFields
in class Expression
public Expression getManualQueryKey(java.lang.String attributeName, ClassDescriptor aDescriptor)
public java.util.List<DatabaseTable> getAdditionalTables()
public java.util.List<DatabaseTable> getOwnedTables()
getOwnedTables
in class Expression
public boolean hasBeenAliased()
Expression
hasBeenAliased
in class DataExpression
public void clearAliases()
clearAliases
in class DataExpression
public boolean isObjectExpression()
Expression
isObjectExpression
in class Expression
public boolean isUsingOuterJoinForMultitableInheritance()
public QueryKeyExpression newDerivedExpressionNamed(java.lang.String attributeName)
public Expression newManualDerivedExpressionNamed(java.lang.String attributeName, ClassDescriptor aDescriptor)
public DatabaseTable getRelationTable()
public boolean isDirectCollection()
public void postCopyIn(java.util.Map alreadyDone, java.util.List<Expression> oldDerivedFields, java.util.List<Expression> oldDerivedTables)
public Expression getOnClause()
public void setOnClause(Expression onClause)
public void setCastClass(java.lang.Class castClass)
public void setShouldUseOuterJoinForMultitableInheritance(boolean shouldUseOuterJoinForMultitableInheritance)
public boolean shouldUseOuterJoin()
public boolean shouldUseOuterJoinForMultitableInheritance()
public Expression getJoinSource()
public void setJoinSource(Expression joinSource)
public java.lang.Integer getOuterJoinExpIndex()
public void setOuterJoinExpIndex(java.lang.Integer outerJoinExpIndex)
public ObjectExpression getFirstNonAggregateExpressionAfterExpressionBuilder(java.util.List aggregateMappingsEncountered)
aggregateMappingsEncountered
- - collection of aggregateObjectMapping expressions encountered in the returned expression
between the first expression and the ExpressionBuilderEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference