ColdBox Platform Version 3.7.0

coldbox.system.orm.hibernate
Class BaseBuilder

WEB-INF.cftags.component
        extended by coldbox.system.orm.hibernate.BaseBuilder
Direct Known Subclasses:
CriteriaBuilder , DetachedCriteriaBuilder

public class BaseBuilder
extends WEB-INF.cftags.component

Constructor Summary
init(string entityName, any criteria, any restrictions)
 
Method Summary
 string GETENTITYNAME()
 any GETNATIVECRITERIA()
 void SETENTITYNAME(string entityName)
 any add(any criterion)
          Add a restriction to constrain the results to be retrieved
private any addProjection([any propertyName], [any projectionType], [any projectionList])
 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)
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])
 any resultTransformer([any resultTransformer])
          Sets a valid hibernate result transformer: org
 any setNativeCriteria(any criteria)
 any setProjection([any projection])
          Setup a single or a projection list via native projections class: criteria
 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
 

Constructor Detail

init

public init(string entityName, any criteria, any restrictions)

Parameters:
entityName
criteria
restrictions
Method Detail

GETENTITYNAME

public string GETENTITYNAME()


GETNATIVECRITERIA

public any GETNATIVECRITERIA()


SETENTITYNAME

public void SETENTITYNAME(string entityName)

Parameters:
entityName

add

public any add(any criterion)
Add a restriction to constrain the results to be retrieved

Parameters:
criterion - A single or array of criterions to add

addProjection

private any addProjection([any propertyName], [any projectionType], [any projectionList])

Parameters:
propertyName
projectionType
projectionList

convertIDValueToJavaType

public 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

Parameters:
id

convertValueToJavaType

public 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

Parameters:
propertyName
value

createAlias

public any createAlias(string associationName, string alias, [numeric joinType])
Join an association, assigning an alias to the joined association.

Parameters:
associationName - The name of the association property
alias - The alias to use for this association property on restrictions
joinType

createCriteria

public any createCriteria(string associationName, [numeric joinType])
Create a new Criteria, "rooted" at the associated entity and using an Inner Join

Parameters:
associationName - The name of the association property to root the restrictions with
joinType

createRestriction

private any createRestriction(string missingMethodName, struct missingMethodArguments)

Parameters:
missingMethodName
missingMethodArguments

normalizeOrder

private void normalizeOrder(string sortOrder, boolean ignoreCase)

Parameters:
sortOrder
ignoreCase

order

public 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

Parameters:
property - The name of the property to order on
sortDir
ignoreCase - Wether to ignore case or not, defaults to false

prepareSQLProjection

private struct prepareSQLProjection([any rawProjection])

Parameters:
rawProjection

resultTransformer

public any resultTransformer([any resultTransformer])
Sets a valid hibernate result transformer: org.hibernate.transform.ResultTransform to use on the results

Parameters:
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.

setNativeCriteria

public any setNativeCriteria(any criteria)

Parameters:
criteria

setProjection

public any setProjection([any projection])
Setup a single or a projection list via native projections class: criteria.projections

Parameters:
projection

withProjections

public 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. 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.

Parameters:
avg - The name of the property to avg or a list or array of property names
count - The name of the property to count or a list or array of property names
countDistinct - The name of the property to count distinct or a list or array of property names
distinct - The name of the property to do a distinct on, this can be a single property name a list or an array of property names
groupProperty - The name of the property to group by or a list or array of property names
id - The projected identifier value
max - The name of the property to max or a list or array of property names
min - The name of the property to min or a list or array of property names
property - The name of the property to do a projected value on or a list or array of property names
rowCount - Do a row count on the criteria
sum - The name of the property to sum or a list or array of property names
sqlProjection - Do a projection based on arbitrary SQL string
sqlGroupProjection - Do a projection based on arbitrary SQL string, with grouping
detachedSQLProjection - Do a projection based on a DetachedCriteria builder config

ColdBox Platform Version 3.7.0