DataFaucet 1.0 Beta

datafaucet.system
Class activerecord

WEB-INF.cftags.component
        extended by datafaucet.system.kernel
            extended by datafaucet.system.duck
                extended by datafaucet.system.broadcaster
                    extended by datafaucet.system.transaction
                        extended by datafaucet.system.arutilities
                            extended by datafaucet.system.arschema
                                extended by datafaucet.system.armanytomany
                                    extended by datafaucet.system.activerecord
Direct Known Subclasses:
compositeactiverecord

public class activerecord
extends armanytomany

provides a base class for Active Record objects


Constructor Summary
init([string objectid=''], [string table=''], [any datasource=''], [any primaryKey=''])
 
Method Summary
private any BroadcastRead(query query)
 any ConfirmDelete([boolean confirm='true'])
 any Create([struct insertdata='[runtime expression]'])
          sets a unique identifier and any additional necessary properties for a new object and saves data to the database
 any Delete()
          removes the instantiated object from the database
 any Read(string objectid='[runtime expression]')
          loads data for the indicated record from the database
 any Update([struct insertdata='[runtime expression]'], [string announcement=''])
          updates the ActiveRecord object and database with new properties
private void addInsertLock(string lockname)
          adds a static lock name to the array of insert locks for the ActiveRecord
private string deleteFromJoinTables()
          performs a sql update or insert statement against the target table
private any executeDelete()
          performs an sql delete statement against the target table
private string executeInsert(struct insertdata)
          performs a sql update or insert statement against the target table
private string executeLockedUpdate(struct insertData, [string setNull=''], [array lockArray], [string announcement=''])
          executed within lockUpdate to perform all required data acitivity for the current transaction
private query executeRead()
          returns the query used to load the object properties
private string executeUpdate([struct insertdata='[runtime expression]'], [string setnull=''])
          performs a sql update or insert statement against the target table
 array getInsertLocks([struct insertdata])
          provides an array of lock names to prevent foreign key constraint violation errors during insert - this method may be overridden to reflect dynamic locks based on foreign key properties
private any getValidator()
private struct handleInsertData(struct insertdata)
private boolean isCreated(struct insertdata)
 any isDeleted()
          indicates if the loaded record has been deleted from the database
 any isLoaded()
          indicates the success of the last read operation (if any)
private string lockUpdate(struct insertData, [string setNull=''], [array lockArray], [string announcement=''])
          locks an insert or update operation to provide helpful error messages when missing required data
 any reset()
          clears all the properties of the active record - does not affect definition structure for tables, columns, etc.
 any setLoaded([boolean loaded='true'])
 any unDelete()
          recreates the record and resets the deleted flag after it's been deleted from the database
private string updateJoinTables([struct insertdata='[runtime expression]'], [string setnull=''])
          performs a sql update or insert statement against the target table
private boolean updatePermitted()
          indicates if the object can be saved to the datasource in its current state
 array validate([struct data='[runtime expression]'])
          returns an array of data validation errors for the columns in this record
 
Methods inherited from class datafaucet.system.armanytomany
addManyToManyRelationship, deleteManyToManyRecords, deleteManyToManyRelationships, getColumnNames, getFailedProperties, getManyToManyColumns, getManyToManyKeys, getManyToManyProperties, getManyToManySelect, getManyToManyTable, insertManyToManyRecords, listManyToManyRecords, readManyToManyProperties, removeManyToManyRelationship, setManyToManyRecords, updateManyToManyRelationships
 
Methods inherited from class datafaucet.system.arschema
ActiveRecordLocale, addTable, fixModifiedColumns, getAuthor, getColumn, getColumns, getCreatedDate, getEditor, getExportedKeys, getForeignKey, getIdentityColumn, getImportedKeys, getInstallScript, getLastModified, getObjectID, getPrimaryColumn, getPrimaryColumnType, getPrimaryProperty, getRequiredColumns, getSchema, getSchemaExport, getSchemaFromProperties, getSchemaTables, getSequence, getTable, getTableArray, getTimeZone, getUninstallDDL, getUpgradeScript, getUpgradeXML, ignoreColumn, install, newID, prepareInsert, prepareUpdate, removeIgnoredColumn, removeIgnoredColumns, removeTable, setColumn, setIdentityValue, setIgnoredColumns, setMetaData, setNewID, setObjectID, setSequence, setTable, throwTableError, uninstall
 
Methods inherited from class datafaucet.system.arutilities
filterSQLStatement, getAllForeignKeys, getColumnMap, getDatasource, getDateProperties, getDefaultLocale, getDefaultTimezone, getForeignKeyValue, getFullTableName, getLocalization, getLock, getORMProperties, getPrimaryKeyData, getProperties, getProtectedColumns, getSQLInsert, getSQLStatement, getSelectStatement, getUTCLocale, hasDatasource, hasLocalization, lock, mapCollectionToProperties, nullForeignKeys, parseDates, queryToStruct, removeNullKeys, setDatasource, setLocalization, setNull, setORMProperties, simplify
 
Methods inherited from class datafaucet.system.transaction
broadcastTransactionCommit, broadcastTransactionRollback, commitTransaction, execute, executeTransactedMethod, getCurrentIsolation, getTransactionDepth, openTransaction, rollbackTransaction, trace
 
Methods inherited from class datafaucet.system.broadcaster
Broadcast, addListener, getListeners
 
Methods inherited from class datafaucet.system.duck
addObserver, getObservers, getProperty, getPropertylist, getValue, identifyAccessorOrMutator, observe, onMissingMethod, raiseMissingMethodException, setProperties, setProperty, setValue
 
Methods inherited from class datafaucet.system.kernel
arg, componentExists, getDataFaucet, getFaucetObject, getFile, getFileModified, getObject, getPlumbing, getTransaction, getTransactionManager, newTransaction, parseDate, setTransaction
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init([string objectid=''], [string table=''], [any datasource=''], [any primaryKey=''])

Parameters:
objectid
table
datasource
primaryKey
Method Detail

BroadcastRead

private any BroadcastRead(query query)

Parameters:
query

ConfirmDelete

public any ConfirmDelete([boolean confirm='true'])

Parameters:
confirm

Create

public any Create([struct insertdata='[runtime expression]'])
sets a unique identifier and any additional necessary properties for a new object and saves data to the database

Parameters:
insertdata

Delete

public any Delete()
removes the instantiated object from the database


Read

public any Read(string objectid='[runtime expression]')
loads data for the indicated record from the database

Parameters:
objectid

Update

public any Update([struct insertdata='[runtime expression]'], [string announcement=''])
updates the ActiveRecord object and database with new properties

Parameters:
insertdata
announcement

addInsertLock

private void addInsertLock(string lockname)
adds a static lock name to the array of insert locks for the ActiveRecord

Parameters:
lockname

deleteFromJoinTables

private string deleteFromJoinTables()
performs a sql update or insert statement against the target table


executeDelete

private any executeDelete()
performs an sql delete statement against the target table


executeInsert

private string executeInsert(struct insertdata)
performs a sql update or insert statement against the target table

Parameters:
insertdata

executeLockedUpdate

private string executeLockedUpdate(struct insertData, [string setNull=''], [array lockArray], [string announcement=''])
executed within lockUpdate to perform all required data acitivity for the current transaction

Parameters:
insertData
setNull
lockArray
announcement

executeRead

private query executeRead()
returns the query used to load the object properties


executeUpdate

private string executeUpdate([struct insertdata='[runtime expression]'], [string setnull=''])
performs a sql update or insert statement against the target table

Parameters:
insertdata
setnull

getInsertLocks

public array getInsertLocks([struct insertdata])
provides an array of lock names to prevent foreign key constraint violation errors during insert - this method may be overridden to reflect dynamic locks based on foreign key properties

Parameters:
insertdata

getValidator

private any getValidator()


handleInsertData

private struct handleInsertData(struct insertdata)

Parameters:
insertdata

isCreated

private boolean isCreated(struct insertdata)

Parameters:
insertdata

isDeleted

public any isDeleted()
indicates if the loaded record has been deleted from the database


isLoaded

public any isLoaded()
indicates the success of the last read operation (if any)


lockUpdate

private string lockUpdate(struct insertData, [string setNull=''], [array lockArray], [string announcement=''])
locks an insert or update operation to provide helpful error messages when missing required data

Parameters:
insertData
setNull
lockArray
announcement

reset

public any reset()
clears all the properties of the active record - does not affect definition structure for tables, columns, etc.

Overrides:
reset in class duck

setLoaded

public any setLoaded([boolean loaded='true'])

Parameters:
loaded

unDelete

public any unDelete()
recreates the record and resets the deleted flag after it's been deleted from the database


updateJoinTables

private string updateJoinTables([struct insertdata='[runtime expression]'], [string setnull=''])
performs a sql update or insert statement against the target table

Parameters:
insertdata
setnull

updatePermitted

private boolean updatePermitted()
indicates if the object can be saved to the datasource in its current state


validate

public array validate([struct data='[runtime expression]'])
returns an array of data validation errors for the columns in this record

Parameters:
data - defaults to the current properties of the object

DataFaucet 1.0 Beta