|
Transfer version 1.1 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
transfer.com.Transfer
public class Transfer
Main class of the transfer lib
| Constructor Summary | |
|---|---|
init(Factory factory)
Constructor |
|
| Method Summary | |
|---|---|
void |
addAfterCreateObserver(any observer)
Adds an object as a observer of after create events |
void |
addAfterDeleteObserver(any observer)
Adds an object as a observer of after delete events |
void |
addAfterNewObserver(any observer)
Adds an object as a observer of after new events |
void |
addAfterUpdateObserver(any observer)
Adds an object as a observer of after update events |
void |
addBeforeCreateObserver(any observer)
Adds an object as a observer of before create events |
void |
addBeforeDeleteObserver(any observer)
Adds an object as a observer of before delete events |
void |
addBeforeUpdateObserver(any observer)
Adds an object as a observer of before update events |
package void |
cache(TransferObject transfer)
Adds the object to the cache manager |
package void |
cacheMiss(string className)
add an extra count to this cache's value not being found |
void |
cascadeCreate(TransferObject transfer, [numeric depth='0'], [boolean useTransaction='true'])
does a cascade down the object hierarchy, calling create() as it goes |
void |
cascadeDelete(TransferObject transfer, [numeric depth='0'], [boolean useTransaction='true'])
does a cascade down the object hierarchy, calling delete() as it goes |
void |
cascadeSave(TransferObject transfer, [numeric depth='0'], [boolean useTransaction='true'])
does a cascade down the object hierarchy, calling save() as it goes |
void |
cascadeUpdate(TransferObject transfer, [numeric depth='0'], [boolean useTransaction='true'])
does a cascade down the object hierarchy, calling update() as it goes |
void |
create(TransferObject transfer, [boolean useTransaction='true'])
Creates a new transfer in the DB. Sets the transfer's ID, and persists the object. |
Query |
createQuery(string tql)
creates a query object for TQL interpretation |
package TransferObjectProxy |
createTransferObjectProxy(string className, any key, struct propertyMap)
creates an object proxy for usage with composites |
void |
delete(TransferObject transfer, [boolean useTransaction='true'])
Deletes a transfer from the database and discard it from persistance. |
void |
discard(TransferObject transfer)
Discard the object from the cache |
void |
discardAll()
Discards all objects from the cache. Generally for development purposes. |
void |
discardByClassAndKey(string className, any key)
Discards an Object by its class and its key, if it exists |
void |
discardByClassAndKeyArray(string className, array keyArray)
Discards an Object by its class and each key in an array, if it exists |
void |
discardByClassAndKeyQuery(string className, query keyQuery, string columnName)
Discards an Object by its class and each key in an array, if it exists |
TransferObject |
get(string class, any key)
Retrieves a populated TransferObject of a given class and primary key. If no object exists for this key, an empty instance of the class is returned. |
private CacheManager |
getCacheManager()
|
CacheMonitor |
getCacheMonitor()
returns the cache monitor |
private Datasource |
getDatasource()
|
private DynamicManager |
getDynamicManager()
|
private EventManager |
getEventManager()
|
private Nullable |
getNullable()
|
private ObjectManager |
getObjectManager()
|
private SQLManager |
getSQLManager()
|
private TQLManager |
getTQLManager()
|
private Transaction |
getTransaction()
|
Object |
getTransferMetaData(string className)
Returns the Object meta data for a given transferobject class |
private Utility |
getUtility()
|
package boolean |
isCached(string class, string key)
Check if a transfer of a particular class is cached |
query |
list(string className, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
Lists a series of object values |
query |
listByProperty(string className, string propertyName, any propertyValue, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
Lists a series of values, filtered by a given value |
query |
listByPropertyMap(string className, struct propertyMap, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
Lists values, filtered by a Struct of Property : Value properties |
query |
listByQuery(Query query)
List by a TQL Query |
package void |
loadManyToMany(TransferObject transfer, string name)
LazyLoads the required manytomany data into an object |
package void |
loadManyToOne(TransferObject transfer, string name)
LazyLoads the required manytone data into an object |
package void |
loadOneToMany(TransferObject transfer, string name)
LazyLoads the required onetomany data into an object |
package void |
loadParentOneToMany(TransferObject transfer, string name)
LazyLoads the required external onetomany data into an object |
TransferObject |
new(string class)
Creates a new, empty TransferObject decorated with the given classes methods |
package string |
rationaliseKey(string class, any key)
rationlises the key, depending on type, to a string |
private TransferObject |
read(string className, query query)
Retrieves an object from a simple row query |
TransferObject |
readByProperty(string className, string propertyName, any propertyValue)
retrieve an object by it's unique property. Throws an Exception if more than one object found |
TransferObject |
readByPropertyMap(string className, struct propertyMap)
retrieve and object by a set of unique properties. Throws an Exception if more than one object found |
TransferObject |
readByQuery(string className, Query query)
retrieve an object by a TQL query. The query must either start with 'from' or only have one column in its result |
void |
recycle(TransferObject transfer)
Recycle an TransferObject for reuse by the system later on. This is good for performance. Only do this once a TransferObject has been deleted or discarded, and is not stored in any shared scopes, as the object's state is reset |
void |
removeAfterCreateObserver(any observer)
removes an observer of after create events |
void |
removeAfterDeleteObserver(any observer)
removes an observer of after Delete events |
void |
removeAfterNewObserver(any observer)
removes an observer of after new events |
void |
removeAfterUpdateObserver(any observer)
removes an observer of after update events |
void |
removeBeforeCreateObserver(any observer)
removes an observer of before create events |
void |
removeBeforeDeleteObserver(any observer)
removes an observer of Before Delete events |
void |
removeBeforeUpdateObserver(any observer)
removes an observer of before update events |
void |
save(TransferObject transfer, [boolean useTransaction='true'])
If the object has yet to be instatiated, it is inserted into the db, otherwise it is updated |
private void |
setCacheManager(CacheManager CacheManager)
|
private void |
setDatasource(Datasource Datasource)
|
private void |
setDynamicManager(DynamicManager DynamicManager)
|
private void |
setEventManager(EventManager EventManager)
|
private void |
setNullable(Nullable Nullable)
|
private void |
setObjectManager(ObjectManager ObjectManager)
|
private void |
setSQLManager(SQLManager SQLManager)
|
private void |
setTQLManager(TQLManager TQLManager)
|
private void |
setTransaction(Transaction transaction)
|
private void |
setTransferObjectEventListeners(any softRef, string className)
configure the event listeners to add to a particular transfer object |
private void |
setUtility(Utility Utility)
|
private any |
throw(string type, string message, [string detail=''])
Throws an Exception |
void |
update(TransferObject transfer, [boolean useTransaction='true'])
Updates the record of a Transfer object in the database |
package boolean |
validateIsCached(TransferObject transfer)
validates if a TransferObject is the same one as in cache |
void |
visitObjectGraph(TransferObject transfer, any visitor, string visitingMethod, [struct visitArgs='[runtime expression]'], [numeric depth='0'], [boolean topDown='true'], [boolean forceLoading='false'])
visit each of the objects in the graph, calling 'visit({transfer:transferObject, visitArgs1...})' on the visitor for each TransferObject in the graph |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init(Factory factory)
factory - the global factory| Method Detail |
|---|
public void addAfterCreateObserver(any observer)
observer - The observerpublic void addAfterDeleteObserver(any observer)
observer - The observerpublic void addAfterNewObserver(any observer)
observer - The observerpublic void addAfterUpdateObserver(any observer)
observer - The observerpublic void addBeforeCreateObserver(any observer)
observer - The observerpublic void addBeforeDeleteObserver(any observer)
observer - The observerpublic void addBeforeUpdateObserver(any observer)
observer - The observerpackage void cache(TransferObject transfer)
transfer - The transfer object to cachepackage void cacheMiss(string className)
className - the className being missedpublic void cascadeCreate(TransferObject transfer, [numeric depth='0'], [boolean useTransaction='true'])
transfer - The transferObject to createdepth - the number of levels in which to cascade, 0 is unlimiteduseTransaction - deprecated: use TransferFactory.getTransaction for transaction management. Whether or not to use an internal transaction blockpublic void cascadeDelete(TransferObject transfer, [numeric depth='0'], [boolean useTransaction='true'])
transfer - The transferObject to createdepth - the number of levels in which to cascade, 0 is unlimiteduseTransaction - deprecated: use TransferFactory.getTransaction for transaction management. Whether or not to use an internal transaction blockpublic void cascadeSave(TransferObject transfer, [numeric depth='0'], [boolean useTransaction='true'])
transfer - The transferObject to createdepth - the number of levels in which to cascade, 0 is unlimiteduseTransaction - deprecated: use TransferFactory.getTransaction for transaction management. Whether or not to use an internal transaction blockpublic void cascadeUpdate(TransferObject transfer, [numeric depth='0'], [boolean useTransaction='true'])
transfer - The transferObject to updatedepth - the number of levels in which to cascade, 0 is unlimiteduseTransaction - deprecated: use TransferFactory.getTransaction for transaction management. Whether or not to use an internal transaction blockpublic void create(TransferObject transfer, [boolean useTransaction='true'])
transfer - The transfer to create in the DBuseTransaction - deprecated: use TransferFactory.getTransaction for transaction management. Whether or not to use an internal transaction blockpublic Query createQuery(string tql)
tql - The Transfer Query Language querypackage TransferObjectProxy createTransferObjectProxy(string className, any key, struct propertyMap)
className - the class name of the To we're creatingkey - the primary key valuepropertyMap - the property map that has been setpublic void delete(TransferObject transfer, [boolean useTransaction='true'])
transfer - The transferObject to deleteuseTransaction - deprecated: use TransferFactory.getTransaction for transaction management. Whether or not to use an internal transaction blockpublic void discard(TransferObject transfer)
transfer - The transferObject to deletepublic void discardAll()
public void discardByClassAndKey(string className, any key)
className - The class name of the object to discardkey - The primary key value for the objectpublic void discardByClassAndKeyArray(string className, array keyArray)
className - The class name of the object to discardkeyArray - The primary key values for the objectpublic void discardByClassAndKeyQuery(string className, query keyQuery, string columnName)
className - The class name of the object to discardkeyQuery - The primary key values for the objectcolumnName - The name of the column the the id is inpublic TransferObject get(string class, any key)
class - The name of the package and class (Case Sensitive)key - Primary key for the object in the DB, string if non composite, struct if compositeprivate CacheManager getCacheManager()
public CacheMonitor getCacheMonitor()
private Datasource getDatasource()
private DynamicManager getDynamicManager()
private EventManager getEventManager()
private Nullable getNullable()
private ObjectManager getObjectManager()
private SQLManager getSQLManager()
private TQLManager getTQLManager()
private Transaction getTransaction()
public Object getTransferMetaData(string className)
className - The class name of the transfer objectprivate Utility getUtility()
package boolean isCached(string class, string key)
class - The name of the classkey - The key for the id of the datapublic query list(string className, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
className - The class of the objects to listorderProperty - The property to order byorderASC - Boolean whether to order by ASC, otherwise order by DESCuseAliases - Boolean as to whether or not to alias columns with the transfer property namespublic query listByProperty(string className, string propertyName, any propertyValue, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
className - The class of the objects to listpropertyName - The name of the property to filter bypropertyValue - The value to filter by (only simple values)orderProperty - The property to order byorderASC - Boolean whether to order by ASC, otherwise order by DESCuseAliases - Boolean as to whether or not to alias columns with the transfer property namespublic query listByPropertyMap(string className, struct propertyMap, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
className - The class of the objects to listpropertyMap - Struct with keys that match to properties, and values to filter byorderProperty - The property to order byorderASC - Boolean whether to order by ASC, otherwise order by DESCuseAliases - Boolean as to whether or not to alias columns with the transfer property namespublic query listByQuery(Query query)
query - A TQL Query objectpackage void loadManyToMany(TransferObject transfer, string name)
transfer - The transfer to load intoname - The name of the manytomany to loadpackage void loadManyToOne(TransferObject transfer, string name)
transfer - The transfer to load intoname - The name of the manytoone to loadpackage void loadOneToMany(TransferObject transfer, string name)
transfer - The transfer to load intoname - The name of the onetomany to loadpackage void loadParentOneToMany(TransferObject transfer, string name)
transfer - The transfer to load intoname - The name of the manytomany to loadpublic TransferObject new(string class)
class - The name of the package and class (Case Sensitive)package string rationaliseKey(string class, any key)
class - The name of the classkey - The key for the id of the dataprivate TransferObject read(string className, query query)
className - The class of the objects to findquery - The query to retrieve frompublic TransferObject readByProperty(string className, string propertyName, any propertyValue)
className - The class of the objects to findpropertyName - The name of the property to findpropertyValue - The value to find (only simple values)public TransferObject readByPropertyMap(string className, struct propertyMap)
className - The class of the objects to listpropertyMap - Struct with keys that match to properties, and values to filter bypublic TransferObject readByQuery(string className, Query query)
className - The class of the objects to findquery - TQL Query objectpublic void recycle(TransferObject transfer)
transfer - The transferObject to deletepublic void removeAfterCreateObserver(any observer)
observer - The observerpublic void removeAfterDeleteObserver(any observer)
observer - The observerpublic void removeAfterNewObserver(any observer)
observer - The observerpublic void removeAfterUpdateObserver(any observer)
observer - The observerpublic void removeBeforeCreateObserver(any observer)
observer - The observerpublic void removeBeforeDeleteObserver(any observer)
observer - The observerpublic void removeBeforeUpdateObserver(any observer)
observer - The observerpublic void save(TransferObject transfer, [boolean useTransaction='true'])
transfer - The transfer to saveuseTransaction - deprecated: use TransferFactory.getTransaction for transaction management. Whether or not to use an internal transaction blockprivate void setCacheManager(CacheManager CacheManager)
CacheManagerprivate void setDatasource(Datasource Datasource)
Datasourceprivate void setDynamicManager(DynamicManager DynamicManager)
DynamicManagerprivate void setEventManager(EventManager EventManager)
EventManagerprivate void setNullable(Nullable Nullable)
Nullableprivate void setObjectManager(ObjectManager ObjectManager)
ObjectManagerprivate void setSQLManager(SQLManager SQLManager)
SQLManagerprivate void setTQLManager(TQLManager TQLManager)
TQLManagerprivate void setTransaction(Transaction transaction)
transactionprivate void setTransferObjectEventListeners(any softRef, string className)
softRef - the soft reference to the Transfer Object to cacheclassName - the classname of the objectprivate void setUtility(Utility Utility)
Utilityprivate any throw(string type, string message, [string detail=''])
type - The type of exceptionmessage - The message to accompany the exceptiondetail - The detail message for the exceptionpublic void update(TransferObject transfer, [boolean useTransaction='true'])
transfer - The transferObject to updateuseTransaction - deprecated: use TransferFactory.getTransaction for transaction management. Whether or not to use an internal transaction blockpackage boolean validateIsCached(TransferObject transfer)
transfer - The transfer object to syncronisepublic void visitObjectGraph(TransferObject transfer, any visitor, string visitingMethod, [struct visitArgs='[runtime expression]'], [numeric depth='0'], [boolean topDown='true'], [boolean forceLoading='false'])
transfer - the starting object to visitvisitor - the visitor objectvisitingMethod - the name of the method that is being visitedvisitArgs - visiting arguments, if there are anydepth - the max depth to go totopDown - travel top down, rather than bottom upforceLoading - if not loaded, force loading
|
Transfer version 1.1 | ||||
| FRAMES | |||||