WEB-INF.cftags.component coldbox.system.orm.hibernate.BaseBuilder
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
boolean
|
SQLLoggerActive
The bit that determines if we are tracking SQL. |
false
|
true
|
false
|
string
|
entityName
The entity name this criteria builder is binded to. |
true
|
false
|
|
any
|
eventManager
The system event manager. |
true
|
false
|
|
any
|
nativeCriteria
The native criteria object. |
true
|
false
|
Constructor Summary | |
---|---|
init(string entityName, any criteria, any restrictions, any ORMService)
|
Method Summary | |
---|---|
string
|
GETENTITYNAME()
get: The entity name this criteria builder is binded to. |
any
|
GETEVENTMANAGER()
get: The system event manager. |
any
|
GETNATIVECRITERIA()
get: The native criteria object. |
boolean
|
GETSQLLOGGERACTIVE()
get: The bit that determines if we are tracking SQL. |
BaseBuilder
|
SETEVENTMANAGER(any eventManager)
set: The system event manager. |
BaseBuilder
|
SETSQLLOGGERACTIVE(boolean SQLLoggerActive)
set: The bit that determines if we are tracking SQL. |
any
|
add(any criterion)
Add a restriction to constrain the results to be retrieved. |
private any
|
addProjection([any propertyName], [any projectionType], [any projectionList])
|
boolean
|
canLogSql()
Returns whether or not CriteriaBuilder is currently configured to log SQL return Boolean. |
any
|
convertIDValueToJavaType(any id)
Coverts an ID, list of ID's, or array of ID's values to the proper java type The method returns a coverted array of ID's. |
any
|
convertValueToJavaType(any propertyName, any value)
Coverts a value to the correct javaType for the property passed in The method returns the value in the proper Java Type. |
any
|
createAlias(string associationName, string alias, [numeric joinType])
Join an association, assigning an alias to the joined association. |
any
|
createCriteria(string associationName, [numeric joinType])
Create a new Criteria, "rooted" at the associated entity and using an Inner Join. |
private any
|
createRestriction(string missingMethodName, struct missingMethodArguments)
|
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. |
string
|
getSQL(boolean returnExecutableSql='false', boolean formatSql='true')
Returns the SQL string that will be prepared for the criteria object at the time of request return string. |
array
|
getSQLLog()
Retrieves the SQL Log return Array. |
private boolean
|
hasProjection()
Checks whether or not a projection is currently applied to the CriteriaBuilder return Boolean. |
void
|
logSQL(String label)
Allows for one-off sql logging at any point in the process of building up CriteriaBuilder; will log the SQL state at the time of the call return void. |
private void
|
normalizeOrder(string sortOrder, boolean ignoreCase)
|
any
|
order(string property, [string sortDir='asc'], [boolean ignoreCase='false'])
Add an ordering to the result set, you can add as many as you like. |
private struct
|
prepareSQLProjection([any rawProjection])
Helper method to prepare sqlProjection for addition to CriteriaBuilder return Struct. |
any
|
resultTransformer([any resultTransformer])
Sets a valid hibernate result transformer: org. |
any
|
setEntityName(any entityName)
set: The entity name this criteria builder is binded to. |
any
|
setNativeCriteria(any criteria)
set: The native criteria object. |
any
|
setProjection([any projection])
Setup a single or a projection list via native projections class: criteria. |
any
|
startSqlLog(Any returnExecutableSql='false', Any formatSql='false')
Triggers CriteriaBuilder to start internally logging the state of SQL at each iterative build return CriteriaBuilder. |
any
|
stopSqlLog()
Stops CriteriaBuilder from continuing to internally log the state of SQL return CriteriaBuilder. |
any
|
withProjections([string avg], [string count], [string countDistinct], [any distinct], [string groupProperty], [boolean id], [string max], [string min], [string property], [boolean rowCount], [string sum], [any sqlProjection], [any sqlGroupProjection], [any detachedSQLProjection])
Setup projections for this criteria query, you can pass one or as many projection arguments as you like. |
Methods inherited from class WEB-INF.cftags.component |
---|
None |
Constructor Detail |
---|
entityName
criteria
restrictions
ORMService
Property Detail |
---|
The bit that determines if we are tracking SQL
serializable
- truerequired
- falseThe entity name this criteria builder is binded to
serializable
- truerequired
- falseThe system event manager
serializable
- truerequired
- falseThe native criteria object
serializable
- truerequired
- falseMethod Detail |
---|
get: The entity name this criteria builder is binded to
get: The system event manager
get: The native criteria object
get: The bit that determines if we are tracking SQL
set: The system event manager
eventManager
set: The bit that determines if we are tracking SQL
SQLLoggerActive
Add a restriction to constrain the results to be retrieved
criterion
- A single or array of criterions to addpropertyName
projectionType
projectionList
Returns whether or not CriteriaBuilder is currently configured to log SQL return Boolean
Coverts an ID, list of ID's, or array of ID's values to the proper java type The method returns a coverted array of ID's
id
Coverts a value to the correct javaType for the property passed in The method returns the value in the proper Java Type
propertyName
value
Join an association, assigning an alias to the joined association.
associationName
- The name of the association propertyalias
- The alias to use for this association property on restrictionsjoinType
Create a new Criteria, "rooted" at the associated entity and using an Inner Join
associationName
- The name of the association property to root the restrictions withjoinType
missingMethodName
missingMethodArguments
Gets 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
Returns the SQL string that will be prepared for the criteria object at the time of request return string
returnExecutableSql
formatSql
Retrieves the SQL Log return Array
Checks whether or not a projection is currently applied to the CriteriaBuilder return Boolean
Allows for one-off sql logging at any point in the process of building up CriteriaBuilder; will log the SQL state at the time of the call return void
label
- {String} The label to use for the sql log recordsortOrder
ignoreCase
Add an ordering to the result set, you can add as many as you like
property
- The name of the property to order onsortDir
ignoreCase
- Wether to ignore case or not, defaults to falseHelper method to prepare sqlProjection for addition to CriteriaBuilder return Struct
rawProjection
- {Struct} The raw projection configurationSets a valid hibernate result transformer: org.hibernate.transform.ResultTransform to use on the results
resultTransformer
- a custom result transform or you can use the included ones: criteria.ALIAS_TO_ENTITY_MAP, criteria.DISTINCT_ROOT_ENTITY, criteria.PROJECTION, criteria.ROOT_ENTITY.set: The entity name this criteria builder is binded to
entityName
set: The native criteria object
criteria
Setup a single or a projection list via native projections class: criteria.projections
projection
Triggers CriteriaBuilder to start internally logging the state of SQL at each iterative build return CriteriaBuilder
returnExecutableSql
- {Boolean} Whether or not to return sql with query params replaced with positional valuesformatSql
- {Boolean} Whether or not to run sql through formatter and wrap the sql in tags for more readable output
Stops CriteriaBuilder from continuing to internally log the state of SQL return CriteriaBuilder
Setup projections for this criteria query, you can pass one or as many projection arguments as you like. The majority of the arguments take in the property name to do the projection on, which will also use that as the alias for the column or you can pass an alias after the property name separated by a : Ex: projections(avg="balance:avgBalance") The alias on the projected value can be referred to in restrictions or orderings. Please also note that the resulting array locations are done in alphabetical order of the arguments.
avg
- The name of the property to avg or a list or array of property namescount
- The name of the property to count or a list or array of property namescountDistinct
- The name of the property to count distinct or a list or array of property namesdistinct
- The name of the property to do a distinct on, this can be a single property name a list or an array of property namesgroupProperty
- The name of the property to group by or a list or array of property namesid
- The projected identifier valuemax
- The name of the property to max or a list or array of property namesmin
- The name of the property to min or a list or array of property namesproperty
- The name of the property to do a projected value on or a list or array of property namesrowCount
- Do a row count on the criteriasum
- The name of the property to sum or a list or array of property namessqlProjection
- Do a projection based on arbitrary SQL stringsqlGroupProjection
- Do a projection based on arbitrary SQL string, with groupingdetachedSQLProjection
- Do a projection based on a DetachedCriteria builder config