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).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.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.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.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
void addJoin(String type, String table, TableJoinColumn[] cols, String a1, String a2, String extraWhere) Add a join to the sql query. -
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
Append a column with an explicit table alias. -
appendColumn
Append a column with the current table alias. -
appendParseSelect
Parse and add formula with standard table alias replacement. -
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. -
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
Return a table alias without many where clause joins. Typically this is for the select clause (fetch joins). -
tableAliasManyWhere
Return a table alias that takes into account many where joins. -
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.
-