ColdBox Platform Version 3.7.0

coldbox.system.orm.hibernate
Class VirtualEntityService

WEB-INF.cftags.component
        extended by coldbox.system.orm.hibernate.BaseORMService
            extended by coldbox.system.orm.hibernate.VirtualEntityService
Direct Known Subclasses:
ActiveEntity

public class VirtualEntityService
extends BaseORMService

******************************************************************************* Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.coldbox.org | www.luismajano.com | www.ortussolutions.com ******************************************************************************* Author : Curt Gratz & Luis Majano Description : This is a Virtual Entity Service that extends the Coldbox BaseORMService to provide easy access to creating virtual services that extend the BaseORMService For example, if you want a UserService, you can either create an object based off this object if no additional functionality is needed like this: UserService=CreateObject("component", "coldbox.system.orm.hibernate.VirtualEntityService").init("User"); You can also use this virtual service as a template object and extend and override as needed. import coldbox.system.orm.hibernate.*; component extends="VirtualEntityService" UserService function init(){ // setup properties setEntityName('User'); setQueryCacheRegion( "#arguments.entityName#.defaultVSCache" ); setUseQueryCaching( false ); setEventHandling( false ); setDefaultAsQuery( true ); return this; }


Constructor Summary
init(string entityname, [string queryCacheRegion], [boolean useQueryCaching], [boolean eventHandling], [boolean useTransactions], [boolean defaultAsQuery], [string datasource])
          *********************************** CONSTRUCTOR ********************************************
 
Method Summary
 string GETDATASOURCE()
          get: The datasource property for this "version" of the Virtual Service
 string GETENTITYNAME()
          get: The entityName property for this "version" of the Virtual Service
 void SETDATASOURCE(string datasource)
          set: The datasource property for this "version" of the Virtual Service
 void SETENTITYNAME(string entityName)
          set: The entityName property for this "version" of the Virtual Service
 void clear([string datasource='[runtime expression]'])
 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
 numeric count([string where=''], [any params='[runtime expression]'])
 numeric countWhere()
 numeric criteriaCount([array criteria='[runtime expression]'])
 any criteriaQuery([array criteria='[runtime expression]'], [string sortOrder=''], [numeric offset='0'], [numeric max='0'], [numeric timeout='0'], [boolean ignoreCase='false'], [boolean asQuery='[runtime expression]'])
 numeric deleteAll([boolean flush='false'], [boolean transactional='[runtime expression]'])
 boolean deleteByID(any id, [boolean flush='false'], [boolean transactional='[runtime expression]'])
 any deleteByQuery(string query, [any params], [numeric max='0'], [numeric offset='0'], [boolean flush='false'], [boolean transactional='[runtime expression]'])
 numeric deleteWhere([boolean transactional='[runtime expression]'])
 void evict([string collectionName], [any id])
 any executeQuery(string query, [any params='[runtime expression]'], [numeric offset='0'], [numeric max='0'], [numeric timeout='0'], [boolean ignorecase='false'], [boolean asQuery='[runtime expression]'], [boolean unique='false'])
          *********************************** PUBLIC ********************************************
 boolean exists(any id)
 array findAllWhere(struct criteria, [string sortOrder=''])
 any findWhere(struct criteria)
 any get(any id, [boolean returnNew='true'])
 array getAll([any id], [string sortOrder=''])
 string getKey()
 array getPropertyNames()
 struct getSessionStatistics([string datasource='[runtime expression]'])
 string getTableName()
 boolean isSessionDirty([string datasource='[runtime expression]'])
 any list([struct criteria='[runtime expression]'], [string sortOrder=''], [numeric offset='0'], [numeric max='0'], [numeric timeout='0'], [boolean ignoreCase='false'], [boolean asQuery='[runtime expression]'])
 any new([struct properties='[runtime expression]'], [boolean composeRelationships='true'], [any nullEmptyInclude=''], [any nullEmptyExclude=''], [boolean ignoreEmpty='false'], [any include=''], [any exclude=''])
 any newCriteria([boolean useQueryCaching='false'], [string queryCacheRegion=''])
 any onMissingMethod([string missingMethodName], [struct missingMethodArguments])
          A nice onMissingMethod template to create awesome dynamic methods based on a virtual service
 
Methods inherited from class coldbox.system.orm.hibernate.BaseORMService
$delete, $deleteAll, $deleteByID, $deleteByQuery, $deleteWhere, $save, $saveAll, $transactioned, GETDEFAULTASQUERY, GETEVENTHANDLING, GETHQLDYNAMICCACHE, GETQUERYCACHEREGION, GETUSEQUERYCACHING, GETUSETRANSACTIONS, SETDEFAULTASQUERY, SETEVENTHANDLING, SETHQLDYNAMICCACHE, SETQUERYCACHEREGION, SETUSEQUERYCACHING, SETUSETRANSACTIONS, compileHQLFromDynamicMethod, createCriteriaQuery, createService, delete, evictEntity, evictQueries, findAll, findByExample, findDynamically, findIt, getEntityGivenName, getRestrictions, merge, populate, populateFromJSON, populateFromQuery, populateFromXML, refresh, save, saveAll, sessionContains
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(string entityname, [string queryCacheRegion], [boolean useQueryCaching], [boolean eventHandling], [boolean useTransactions], [boolean defaultAsQuery], [string datasource])
*********************************** CONSTRUCTOR ********************************************

Parameters:
entityname
queryCacheRegion
useQueryCaching
eventHandling
useTransactions
defaultAsQuery
datasource
Method Detail

GETDATASOURCE

public string GETDATASOURCE()
get: The datasource property for this "version" of the Virtual Service


GETENTITYNAME

public string GETENTITYNAME()
get: The entityName property for this "version" of the Virtual Service


SETDATASOURCE

public void SETDATASOURCE(string datasource)
set: The datasource property for this "version" of the Virtual Service

Parameters:
datasource

SETENTITYNAME

public void SETENTITYNAME(string entityName)
set: The entityName property for this "version" of the Virtual Service

Parameters:
entityName

clear

public void clear([string datasource='[runtime expression]'])

Overrides:
clear in class BaseORMService
Parameters:
datasource

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

Overrides:
convertIDValueToJavaType in class BaseORMService
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

Overrides:
convertValueToJavaType in class BaseORMService
Parameters:
propertyName
value

count

public numeric count([string where=''], [any params='[runtime expression]'])

Overrides:
count in class BaseORMService
Parameters:
where
params

countWhere

public numeric countWhere()

Overrides:
countWhere in class BaseORMService

criteriaCount

public numeric criteriaCount([array criteria='[runtime expression]'])

Overrides:
criteriaCount in class BaseORMService
Parameters:
criteria

criteriaQuery

public any criteriaQuery([array criteria='[runtime expression]'], [string sortOrder=''], [numeric offset='0'], [numeric max='0'], [numeric timeout='0'], [boolean ignoreCase='false'], [boolean asQuery='[runtime expression]'])

Overrides:
criteriaQuery in class BaseORMService
Parameters:
criteria
sortOrder
offset
max
timeout
ignoreCase
asQuery

deleteAll

public numeric deleteAll([boolean flush='false'], [boolean transactional='[runtime expression]'])

Overrides:
deleteAll in class BaseORMService
Parameters:
flush
transactional

deleteByID

public boolean deleteByID(any id, [boolean flush='false'], [boolean transactional='[runtime expression]'])

Overrides:
deleteByID in class BaseORMService
Parameters:
id
flush
transactional

deleteByQuery

public any deleteByQuery(string query, [any params], [numeric max='0'], [numeric offset='0'], [boolean flush='false'], [boolean transactional='[runtime expression]'])

Overrides:
deleteByQuery in class BaseORMService
Parameters:
query
params
max
offset
flush
transactional

deleteWhere

public numeric deleteWhere([boolean transactional='[runtime expression]'])

Overrides:
deleteWhere in class BaseORMService
Parameters:
transactional

evict

public void evict([string collectionName], [any id])

Overrides:
evict in class BaseORMService
Parameters:
collectionName
id

executeQuery

public any executeQuery(string query, [any params='[runtime expression]'], [numeric offset='0'], [numeric max='0'], [numeric timeout='0'], [boolean ignorecase='false'], [boolean asQuery='[runtime expression]'], [boolean unique='false'])
*********************************** PUBLIC ********************************************

Overrides:
executeQuery in class BaseORMService
Parameters:
query
params
offset
max
timeout
ignorecase
asQuery
unique

exists

public boolean exists(any id)

Overrides:
exists in class BaseORMService
Parameters:
id

findAllWhere

public array findAllWhere(struct criteria, [string sortOrder=''])

Overrides:
findAllWhere in class BaseORMService
Parameters:
criteria
sortOrder

findWhere

public any findWhere(struct criteria)

Overrides:
findWhere in class BaseORMService
Parameters:
criteria

get

public any get(any id, [boolean returnNew='true'])

Overrides:
get in class BaseORMService
Parameters:
id
returnNew

getAll

public array getAll([any id], [string sortOrder=''])

Overrides:
getAll in class BaseORMService
Parameters:
id
sortOrder

getKey

public string getKey()

Overrides:
getKey in class BaseORMService

getPropertyNames

public array getPropertyNames()

Overrides:
getPropertyNames in class BaseORMService

getSessionStatistics

public struct getSessionStatistics([string datasource='[runtime expression]'])

Overrides:
getSessionStatistics in class BaseORMService
Parameters:
datasource

getTableName

public string getTableName()

Overrides:
getTableName in class BaseORMService

isSessionDirty

public boolean isSessionDirty([string datasource='[runtime expression]'])

Overrides:
isSessionDirty in class BaseORMService
Parameters:
datasource

list

public any list([struct criteria='[runtime expression]'], [string sortOrder=''], [numeric offset='0'], [numeric max='0'], [numeric timeout='0'], [boolean ignoreCase='false'], [boolean asQuery='[runtime expression]'])

Overrides:
list in class BaseORMService
Parameters:
criteria
sortOrder
offset
max
timeout
ignoreCase
asQuery

new

public any new([struct properties='[runtime expression]'], [boolean composeRelationships='true'], [any nullEmptyInclude=''], [any nullEmptyExclude=''], [boolean ignoreEmpty='false'], [any include=''], [any exclude=''])

Overrides:
new in class BaseORMService
Parameters:
properties
composeRelationships
nullEmptyInclude
nullEmptyExclude
ignoreEmpty
include
exclude

newCriteria

public any newCriteria([boolean useQueryCaching='false'], [string queryCacheRegion=''])

Overrides:
newCriteria in class BaseORMService
Parameters:
useQueryCaching
queryCacheRegion

onMissingMethod

public any onMissingMethod([string missingMethodName], [struct missingMethodArguments])
A nice onMissingMethod template to create awesome dynamic methods based on a virtual service

Overrides:
onMissingMethod in class BaseORMService
Parameters:
missingMethodName
missingMethodArguments

ColdBox Platform Version 3.7.0