Interface DbSqlContext
public interface DbSqlContext
Used to provide context during sql construction.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddEncryptedProp(BeanProperty prop) Add an encrypted property which will require additional binding.voidaddExtraJoin(SqlTreeJoin treeJoin) Delay adding an extra join to support inheritance discriminator in projection (IF required).default voidaddFormula2Join(String joinLiteral, String table, String a2, String foreignIdCol, String resolvedFkExpr) Append a join where the ON clause FK side is a pre-resolved @Formula2 expression.voidAdd a join to the sql query.Append a string directly to the SQL buffer.voidappendColumn(String column) Append a column with the current table alias.voidappendColumn(String tableAlias, String column) Append a column with an explicit table alias.voidappendFormula2Select(String parseSelect) Parse and add a @Formula2 path based formula resolving the path placeholders (e.g. ${} or ${parent}) relative to the current node prefix.voidappendFormulaJoin(String sqlFormulaJoin, SqlJoinType joinType, String tableAlias) Append a Sql Formula join.voidappendFormulaSelect(String sqlFormulaSelect) Append a Sql Formula select.voidAppend 'for update' lock hints on FROM clause (sql server only).voidAppend the lower and upper bound columns into the select clause for findVersions() queries.voidappendParseSelect(String parseSelect, String alias) Parse and add formula with standard table alias replacement.voidappendRawColumn(String rawColumnWithTableAlias) Add a raw column to the sql.intReturn the count of history table AS OF predicates added via joins.content()Return the current context of the sql context.Return a list of encrypted properties which require additional binding.voidAdd extra joins *IF* required to support inheritance discriminator in projection.voidInclude the filter many predicates if specified into the JOIN clause.booleanisFilterManyAttachPoint(String prefix) Return true if the given fetch path (relative to the query root) is the exact join clause that the pending filterMany predicate must be attached to - i.e. the deepest path the filterMany expression itself references.booleanReturn true if the query includes soft deleted rows.booleanReturn true if the last join was added and false means the join was suppressed as it was already added to the query.intlength()Return the current content length.default StringparseFormula2(String formula, String prefix) Parse a @Formula2 expression, resolving path placeholders (e.g. ${} or ${parent}) relative to the given parent prefix.Peek the current table alias.voidpopJoin()Pop a join node off the stack.voidPop the current table alias from the stack.voidPush a join node onto the stack.voidpushTableAlias(String tableAlias) Push the current table alias onto the stack.relativePrefix(String propName) voidStart group by clause.tableAlias(String prefix) Return a table alias without many where clause joins.tableAliasManyWhere(String prefix) Return a table alias that takes into account many where joins.
-
Method Details
-
addJoin
-
pushTableAlias
Push the current table alias onto the stack. -
popTableAlias
void popTableAlias()Pop the current table alias from the stack. -
addEncryptedProp
Add an encrypted property which will require additional binding. -
encryptedProps
BeanProperty[] encryptedProps()Return a list of encrypted properties which require additional binding. -
append
Append a string directly to the SQL buffer. -
peekTableAlias
String peekTableAlias()Peek the current table alias. -
appendRawColumn
Add a raw column to the sql. -
appendColumn
-
appendColumn
Append a column with the current table alias. -
appendParseSelect
-
appendFormula2Select
Parse and add a @Formula2 path based formula resolving the path placeholders (e.g. ${} or ${parent}) relative to the current node prefix. -
appendFormulaSelect
Append a Sql Formula select. This converts the "${ta}" keyword to the current table alias. -
appendFormulaJoin
Append a Sql Formula join. This converts the "${ta}" keyword to the current table alias. -
parseFormula2
-
addFormula2Join
-
length
int length()Return the current content length. -
content
String content()Return the current context of the sql context. -
pushJoin
Push a join node onto the stack. -
popJoin
void popJoin()Pop a join node off the stack. -
tableAlias
-
tableAliasManyWhere
-
relativePrefix
-
appendHistorySysPeriod
void appendHistorySysPeriod()Append the lower and upper bound columns into the select clause for findVersions() queries. -
isIncludeSoftDelete
boolean isIncludeSoftDelete()Return true if the query includes soft deleted rows. -
asOfTableCount
int asOfTableCount()Return the count of history table AS OF predicates added via joins. -
startGroupBy
void startGroupBy()Start group by clause. -
appendFromForUpdate
void appendFromForUpdate()Append 'for update' lock hints on FROM clause (sql server only). -
addExtraJoin
Delay adding an extra join to support inheritance discriminator in projection (IF required). -
flushExtraJoins
void flushExtraJoins()Add extra joins *IF* required to support inheritance discriminator in projection. -
joinAdded
boolean joinAdded()Return true if the last join was added and false means the join was suppressed as it was already added to the query. -
includeFilterMany
void includeFilterMany()Include the filter many predicates if specified into the JOIN clause. -
isFilterManyAttachPoint
Return true if the given fetch path (relative to the query root) is the exact join clause that the pending filterMany predicate must be attached to - i.e. the deepest path the filterMany expression itself references.
-