WEB-INF.cftags.component coldbox.system.orm.hibernate.sql.SQLHelper
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
boolean
|
formatSql
Format the SQL or not. |
false
|
true
|
false
|
array
|
log
The log array. |
true
|
false
|
|
boolean
|
returnExecutableSql
Bit to return the executable SQL or not. |
false
|
true
|
false
|
Constructor Summary | |
---|---|
init(any criteriaBuilder, [boolean returnExecutableSql='false'], [boolean formatSql='false'])
Constructor. |
Method Summary | |
---|---|
boolean
|
GETFORMATSQL()
get: Format the SQL or not. |
array
|
GETLOG()
get: The log array. |
boolean
|
GETRETURNEXECUTABLESQL()
get: Bit to return the executable SQL or not. |
SQLHelper
|
SETFORMATSQL(boolean formatSql)
set: Format the SQL or not. |
SQLHelper
|
SETLOG(array log)
set: The log array. |
SQLHelper
|
SETRETURNEXECUTABLESQL(boolean returnExecutableSql)
set: Bit to return the executable SQL or not. |
string
|
applyFormatting(string sql)
Applies pretty formatting to a sql string return string. |
private Array
|
bindLimitParameters(Array positionalValues, Boolean append, any selection)
Inserts parameter values into the running list based on the dialect of the database engine return Array. |
Boolean
|
canLogLimitOffset()
|
private array
|
convertToCFArray(any array)
Small utility method to convert weird arrays from Java methods into something CF understands return Array. |
string
|
generateSQLAlias()
Generates a unique SQL Alias within the criteria query return string. |
private any
|
getCriteriaJoinWalker()
gets an instance of CriteriaJoinWalker, which can allow for translating criteria query into a sql string returns CriteriaJoinWalker. |
private any
|
getCriteriaQueryTranslator()
gets an instance of CriteriaQueryTranslator, which can prepares criteria query for conversion to SQL returns CriteriaQueryTranslator. |
any
|
getDialect()
Retrieves the correct dialect of the database engine return any. |
private Numeric
|
getFirstRow(any selection)
Gets the first row (or 0) for the current row selection return Numeric. |
private Numeric
|
getMaxOrLimit(any selection)
Gets correct "limit" value for the current row selection return Numeric. |
any
|
getPositionalSQLParameterTypes(Boolean simple='true')
Gets positional SQL parameter types from the criteria query return any. |
array
|
getPositionalSQLParameterValues()
Gets the positional SQL parameter values from the criteria query return array. |
Array
|
getPositionalSQLParameters()
Returns a formatted array of parameter value and types return array. |
any
|
getProjectedTypes()
Retrieves the projected types of the criteria query return string. |
string
|
getProjectionAlias()
Get the alias of the current projection return string. |
private any
|
getQueryParameters()
Gets currently applied query parameters for the query object return org. |
string
|
getRootSQLAlias()
Retrieves the "rooted" SQL alias for the criteria query return string. |
string
|
getSQL(boolean returnExecutableSql='[runtime expression]', boolean formatSql='[runtime expression]')
Returns the SQL string that will be prepared for the criteria object at the time of request return string. |
private Boolean
|
hasMaxRows(any selection)
Determines whether the current row selection has a limit already applied return Boolean. |
any
|
log(string label='Criteria')
Logs current state of criteria to internal tracking log return void. |
private string
|
replaceQueryParameters(string sql)
replace query parameter placeholders with their actual values (for detachedSQLProjection) returns string. |
private Boolean
|
useLimit(any selection)
Determines whether the database engine allows for the use of "limit/offset" syntax return Boolean. |
Methods inherited from class WEB-INF.cftags.component |
---|
None |
Constructor Detail |
---|
Constructor
criteriaBuilder
returnExecutableSql
formatSql
Property Detail |
---|
Format the SQL or not.
serializable
- truerequired
- falseThe log array
serializable
- truerequired
- falseBit to return the executable SQL or not
serializable
- truerequired
- falseMethod Detail |
---|
get: Format the SQL or not.
get: The log array
get: Bit to return the executable SQL or not
set: Format the SQL or not.
formatSql
set: The log array
log
set: Bit to return the executable SQL or not
returnExecutableSql
Applies pretty formatting to a sql string return string
sql
- {string} The SQL string to formatInserts parameter values into the running list based on the dialect of the database engine return Array
positionalValues
- {Array} The positional values for this queryappend
- {Boolean} Whether values are appended or prepended to the arrayselection
- {any} The current row selectionSmall utility method to convert weird arrays from Java methods into something CF understands return Array
array
- {Array} The array to convertGenerates a unique SQL Alias within the criteria query return string
gets an instance of CriteriaJoinWalker, which can allow for translating criteria query into a sql string returns CriteriaJoinWalker
gets an instance of CriteriaQueryTranslator, which can prepares criteria query for conversion to SQL returns CriteriaQueryTranslator
Retrieves the correct dialect of the database engine return any
Gets the first row (or 0) for the current row selection return Numeric
selection
- {any} The current row selectionGets correct "limit" value for the current row selection return Numeric
selection
- {any} The current row selectionGets positional SQL parameter types from the criteria query return any
simple
- {Boolean} Whether to return a simply array or full objectsGets the positional SQL parameter values from the criteria query return array
Returns a formatted array of parameter value and types return array
Retrieves the projected types of the criteria query return string
Get the alias of the current projection return string
Gets currently applied query parameters for the query object return org.hibernate.engine.QueryParameters
Retrieves the "rooted" SQL alias for the criteria query return string
Returns the SQL string that will be prepared for the criteria object at the time of request return string
returnExecutableSql
- {Boolean} Whether or not to do query param replacements on returned SQL stringformatSql
- {Boolean} Whether to format the sqlDetermines whether the current row selection has a limit already applied return Boolean
selection
- {any} The current row selectionLogs current state of criteria to internal tracking log return void
label
- {string} The label for the log recordreplace query parameter placeholders with their actual values (for detachedSQLProjection) returns string
sql
- (string) The sql string to massageDetermines whether the database engine allows for the use of "limit/offset" syntax return Boolean
selection
- {any} The current row selection