| Modifier and Type | Field and Description |
|---|---|
| protected Class | castClass
Allow an expression node to be cast to a subclass or implementation class. |
| public List | |
| protected transient ClassDescriptor | |
| protected boolean | hasBeenAliased
Allow hasBeenAliased to be marked independently from the existence of the tableAliases collection. |
| protected Expression | joinSource
Defines that this expression has been joined to the source expression. |
| protected Expression | onClause
Allow for an ON clause to be specified on a join condition. |
| private Integer | outerJoinExpIndex
Used to track the index of the OuterJoinExpressionHolder that might be associated to this expression |
| protected boolean | shouldUseOuterJoin
Is this query key to be resolved using an outer join or not. |
| protected boolean | shouldUseOuterJoinForMultitableInheritance
indicates whether subclasses should be joined |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | addDerivedExpression(Expression addThis)
INTERNAL: Add the expression as a derived child of this expression. |
| public Expression | additionalExpressionCriteria()
INTERNAL: Return the expression to join the main table of this node to any auxiliary tables. |
| public Map | additionalExpressionCriteriaMap()
INTERNAL: Used in case outer joins should be printed in FROM clause. |
| public Expression | anyOf(String attributeName, boolean
indicates whether a new expression should be created. shouldJoinBeIndependent)Overrides org. |
| public Expression | anyOfAllowingNone(String attributeName, boolean
indicates whether a new expression should be created. shouldJoinBeIndependent)Overrides org. |
| public int | assignTableAliasesStartingAt(int initialValue)
Overrides org. |
| public void | clearAliases()
Overrides org. |
| public 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. |
| public List | |
| public QueryKeyExpression | |
| public Expression | |
| public void | |
| public void | |
| public boolean | equals(Object
the reference object with which to compare. expression)Overrides org. |
| public QueryKeyExpression | |
| public Expression | get(String attributeName, boolean
- allows the get to not force an inner-join (if getAllowingNull was used elsewhere). forceInnerJoin)Overrides org. |
| public List | getAdditionalTables()
Return any tables in addition to the descriptor's tables, such as the mappings join table. |
| public Expression | getAllowingNull(String attributeName)
Overrides org. |
| public Class | |
| public ClassDescriptor | |
| public Vector | getFields()
Overrides org. |
| public ObjectExpression | Returns: first non-AggregateObjectMapping expression after the base ExpressionBuilder from the fullExpression- collection of aggregateObjectMapping expressions encountered in the returned expression
between the first expression and the ExpressionBuilder aggregateMappingsEncountered)INTERNAL: Parses an expression to return the first non-AggregateObjectMapping expression after the base ExpressionBuilder. |
| protected Vector | getForUpdateOfFields()
INTERNAL: Returns the first field from each of the owned tables, used for fine-grained pessimistic locking. |
| public Expression | |
| public Expression | |
| public Expression | |
| public Integer | |
| public List | getOwnedTables()
Overrides org. |
| public DatabaseTable | |
| public List | getSelectionFields(ReadQuery query)
Overrides org. |
| public boolean | hasBeenAliased()
Overrides org. |
| protected boolean | |
| public boolean | |
| public boolean | isDowncast(ClassDescriptor rootDescriptor, AbstractSession session)
INTERNAL Return true if it uses a cast class and query is downcasting. |
| public boolean | isObjectExpression()
Overrides org. |
| public boolean | |
| public boolean | isUsingOuterJoinForMultitableInheritance()
INTERNAL: indicates whether additional expressions for multitable inheritance should be used and are available |
| public Expression | join(Expression target, Expression onClause)
Overrides org. |
| public Expression | leftJoin(Expression target, Expression onClause)
Overrides org. |
| public QueryKeyExpression | |
| public Expression | |
| protected void | postCopyIn(Map<K, V> alreadyDone)
Overrides org. |
| public void | postCopyIn(Map<K, V> alreadyDone, List<Expression> oldDerivedFields, List<Expression> oldDerivedTables)
INTERNAL: The method was added to circumvent derivedFields and derivedTables being protected. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setShouldUseOuterJoinForMultitableInheritance(boolean shouldUseOuterJoinForMultitableInheritance)
INTERNAL: set the flag indicating whether subclasses should be joined |
| public boolean | |
| public boolean | |
| public Expression | treat(Class<?> castClass)
Overrides org. |
| public Expression | type()
Overrides org. |
| protected void | writeForUpdateOfFields(ExpressionSQLPrinter printer, SQLSelectStatement statement)
INTERNAL: writes the first field from each of the owned tables, used for fine-grained pessimistic locking. |
| castClass | back to summary |
|---|---|
| protected Class<?> castClass Allow an expression node to be cast to a subclass or implementation class. | |
| derivedExpressions | back to summary |
|---|---|
| public List<Expression> derivedExpressions | |
| descriptor | back to summary |
|---|---|
| protected transient ClassDescriptor descriptor | |
| hasBeenAliased | back to summary |
|---|---|
| protected boolean hasBeenAliased Allow hasBeenAliased to be marked independently from the existence of the tableAliases collection. | |
| joinSource | back to summary |
|---|---|
| protected Expression joinSource Defines that this expression has been joined to the source expression. | |
| onClause | back to summary |
|---|---|
| protected Expression onClause Allow for an ON clause to be specified on a join condition. | |
| outerJoinExpIndex | back to summary |
|---|---|
| private Integer outerJoinExpIndex Used to track the index of the OuterJoinExpressionHolder that might be associated to this expression | |
| shouldUseOuterJoin | back to summary |
|---|---|
| protected boolean shouldUseOuterJoin Is this query key to be resolved using an outer join or not. Does not apply to attributes. | |
| shouldUseOuterJoinForMultitableInheritance | back to summary |
|---|---|
| protected boolean shouldUseOuterJoinForMultitableInheritance indicates whether subclasses should be joined | |
| ObjectExpression | back to summary |
|---|---|
| protected ObjectExpression() | |
| addDerivedExpression | back to summary |
|---|---|
| public synchronized void addDerivedExpression(Expression addThis) INTERNAL: Add the expression as a derived child of this expression. i.e. e.get("name"), "name" is a derived child of "e". | |
| additionalExpressionCriteria | back to summary |
|---|---|
| public Expression additionalExpressionCriteria() INTERNAL: Return the expression to join the main table of this node to any auxiliary tables. | |
| additionalExpressionCriteriaMap | back to summary |
|---|---|
| public Map INTERNAL: Used in case outer joins should be printed in FROM clause. Each of the additional tables mapped to expressions that joins it. | |
| anyOf | back to summary |
|---|---|
| public Expression anyOf(String attributeName, boolean shouldJoinBeIndependent) Overrides org. PUBLIC: Return an expression representing traversal of a 1:many or many:many relationship. This allows you to query whether any of the "many" side of the relationship satisfies the remaining criteria. 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 | back to summary |
|---|---|
| public Expression anyOfAllowingNone(String attributeName, boolean shouldJoinBeIndependent) Overrides org. ADVANCED: Return an expression representing traversal of a 1:many or many:many relationship. This allows you to query whether any of the "many" side of the relationship satisfies the remaining criteria. 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')
| |
| assignTableAliasesStartingAt | back to summary |
|---|---|
| public int assignTableAliasesStartingAt(int initialValue) Overrides org. INTERNAL: Assign aliases to any tables which I own. Start with t(initialValue), and return the new value of the counter , i.e. if initialValue is one and I have tables ADDRESS and EMPLOYEE I will assign them t1 and t2 respectively, and return 3.
| |
| clearAliases | back to summary |
|---|---|
| public void clearAliases() Overrides org. INTERNAL:
| |
| convertToCastDescriptor | back to summary |
|---|---|
| public 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. | |
| copyDerivedExpressions | back to summary |
|---|---|
| public List | |
| derivedExpressionNamed | back to summary |
|---|---|
| public QueryKeyExpression derivedExpressionNamed(String attributeName) | |
| derivedManualExpressionNamed | back to summary |
|---|---|
| public Expression derivedManualExpressionNamed(String attributeName, ClassDescriptor aDescriptor) | |
| doNotUseOuterJoin | back to summary |
|---|---|
| public void doNotUseOuterJoin() | |
| doUseOuterJoin | back to summary |
|---|---|
| public void doUseOuterJoin() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object expression) Overrides org. INTERNAL: Return if the expression is equal to the other. This is used to allow dynamic expression's SQL to be cached.
| |
| existingDerivedExpressionNamed | back to summary |
|---|---|
| public QueryKeyExpression existingDerivedExpressionNamed(String attributeName) | |
| get | back to summary |
|---|---|
| public Expression get(String attributeName, boolean forceInnerJoin) Overrides org. Return the expression from the attribute dervied from this expression.
| |
| getAdditionalTables | back to summary |
|---|---|
| public List Return any tables in addition to the descriptor's tables, such as the mappings join table. | |
| getAllowingNull | back to summary |
|---|---|
| public Expression getAllowingNull(String attributeName) Overrides org. Doc from org. ADVANCED: Return an expression that wraps the attribute or query key name. This is only applicable to 1:1 relationships, and allows the target of the relationship to be null if there is no corresponding relationship in the database. Implemented via an outer join in the database. Example:
| |
| getCastClass | back to summary |
|---|---|
| public Class | |
| getDescriptor | back to summary |
|---|---|
| public ClassDescriptor getDescriptor() Overrides org.
| |
| getFields | back to summary |
|---|---|
| public Vector Overrides org. INTERNAL: Not to be confused with the public getField(String) This returns a collection of all fields associated with this object. Really only applies to query keys representing an object or to expression builders.
| |
| getFirstNonAggregateExpressionAfterExpressionBuilder | back to summary |
|---|---|
| public ObjectExpression getFirstNonAggregateExpressionAfterExpressionBuilder(List<E> aggregateMappingsEncountered) INTERNAL: Parses an expression to return the first non-AggregateObjectMapping expression after the base ExpressionBuilder. This is used by joining and batch fetch to get the list of mappings that really need to be processed (non-aggregates).
| |
| getForUpdateOfFields | back to summary |
|---|---|
| protected Vector INTERNAL: Returns the first field from each of the owned tables, used for fine-grained pessimistic locking. | |
| getJoinSource | back to summary |
|---|---|
| public Expression getJoinSource() | |
| getManualQueryKey | back to summary |
|---|---|
| public Expression getManualQueryKey(String attributeName, ClassDescriptor aDescriptor) | |
| getOnClause | back to summary |
|---|---|
| public Expression getOnClause() | |
| getOuterJoinExpIndex | back to summary |
|---|---|
| public Integer getOuterJoinExpIndex() | |
| getOwnedTables | back to summary |
|---|---|
| public List Overrides org. Return any tables that are defined by this expression (and not its base).
| |
| getRelationTable | back to summary |
|---|---|
| public DatabaseTable getRelationTable() Return null by default, only QueryKeyExpression can have a relation table. | |
| getSelectionFields | back to summary |
|---|---|
| public List Overrides org. INTERNAL:
| |
| hasBeenAliased | back to summary |
|---|---|
| public boolean hasBeenAliased() Overrides org. Doc from org. INTERNAL: Answers if the database tables associated with this expression have been aliased. This insures the same tables are not aliased twice.
| |
| hasDerivedExpressions | back to summary |
|---|---|
| protected boolean hasDerivedExpressions() | |
| isDirectCollection | back to summary |
|---|---|
| public boolean isDirectCollection() Return false by default, only possible for QueryKeyExpression. | |
| isDowncast | back to summary |
|---|---|
| public boolean isDowncast(ClassDescriptor rootDescriptor, AbstractSession session) INTERNAL Return true if it uses a cast class and query is downcasting. It will look into inheritance hierarchy of the root descriptor. | |
| isObjectExpression | back to summary |
|---|---|
| public boolean isObjectExpression() Overrides org. Doc from org. INTERNAL:
| |
| isTreatUsed | back to summary |
|---|---|
| public boolean isTreatUsed() INTERNAL Return true if treat was used on this expression | |
| isUsingOuterJoinForMultitableInheritance | back to summary |
|---|---|
| public boolean isUsingOuterJoinForMultitableInheritance() INTERNAL: indicates whether additional expressions for multitable inheritance should be used and are available | |
| join | back to summary |
|---|---|
| public Expression join(Expression target, Expression onClause) Overrides org. Defines a join between this expression and the target expression based on the ON clause.
| |
| leftJoin | back to summary |
|---|---|
| public Expression leftJoin(Expression target, Expression onClause) Overrides org. Defines a join between this expression and the target expression based on the ON clause.
| |
| newDerivedExpressionNamed | back to summary |
|---|---|
| public QueryKeyExpression newDerivedExpressionNamed(String attributeName) | |
| newManualDerivedExpressionNamed | back to summary |
|---|---|
| public Expression newManualDerivedExpressionNamed(String attributeName, ClassDescriptor aDescriptor) | |
| postCopyIn | back to summary |
|---|---|
| protected void postCopyIn(Map<K, V> alreadyDone) Overrides org. INTERNAL: Used for cloning.
| |
| postCopyIn | back to summary |
|---|---|
| public void postCopyIn(Map<K, V> alreadyDone, List<Expression> oldDerivedFields, List<Expression> oldDerivedTables) INTERNAL: The method was added to circumvent derivedFields and derivedTables being protected. | |
| setCastClass | back to summary |
|---|---|
| public void setCastClass(Class<?> castClass) | |
| setJoinSource | back to summary |
|---|---|
| public void setJoinSource(Expression joinSource) | |
| setOnClause | back to summary |
|---|---|
| public void setOnClause(Expression onClause) | |
| setOuterJoinExpIndex | back to summary |
|---|---|
| public void setOuterJoinExpIndex(Integer outerJoinExpIndex) | |
| setShouldUseOuterJoinForMultitableInheritance | back to summary |
|---|---|
| public void setShouldUseOuterJoinForMultitableInheritance(boolean shouldUseOuterJoinForMultitableInheritance) INTERNAL: set the flag indicating whether subclasses should be joined | |
| shouldUseOuterJoin | back to summary |
|---|---|
| public boolean shouldUseOuterJoin() | |
| shouldUseOuterJoinForMultitableInheritance | back to summary |
|---|---|
| public boolean shouldUseOuterJoinForMultitableInheritance() | |
| treat | back to summary |
|---|---|
| public Expression treat(Class<?> castClass) Overrides org. 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. 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"
| |
| type | back to summary |
|---|---|
| public Expression type() Overrides org. PUBLIC: Return an expression that wraps the inheritance type field in an expression. Example: builder.getClassForInheritance().equal(SmallProject.class);
| |
| writeForUpdateOfFields | back to summary |
|---|---|
| protected void writeForUpdateOfFields(ExpressionSQLPrinter printer, SQLSelectStatement statement) INTERNAL: writes the first field from each of the owned tables, used for fine-grained pessimistic locking. | |