Transfer version 1.1

transfer.com.sql
Class SQLManager

WEB-INF.cftags.component
        extended by transfer.com.sql.SQLManager

public class SQLManager
extends WEB-INF.cftags.component

Top level configuration manager for SQL objects


Constructor Summary
init(SQLFactory sqlFactory)
          Constructor
 
Method Summary
 void create(TransferObject transfer, boolean useTransaction)
          Inserts the transfer into the DB
 void delete(TransferObject transfer, boolean useTransaction)
          Deletes a transfer object
 query getInsertRefreshQuery(TransferObject transfer)
          Returns the refresh query for an insert
 Nullable getNullable()
 any getPropertyColumnValue(query query, Object object, Property property)
          Returns the column value, but returns the default null value for the item if it is NULL
private SQLValue getSQLValue()
private TransferDeleter getTransferDeleter()
private TransferGateway getTransferGateway()
private TransferInserter getTransferInserter()
private TransferRefresher getTransferRefresher()
private TransferSelecter getTransferSelecter()
private TransferUpdater getTransferUpdater()
 query getUpdateRefreshQuery(TransferObject transfer)
          Returns the refresh query for an insert
 boolean hasInsertRefresh(TransferObject transfer)
          Check to see if it requires a run of the refresh query
 boolean hasUpdateRefresh(TransferObject transfer)
          Check to see if it requires a run of the refresh query
 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, boolean onlyRetrievePrimaryKey, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
          Lists a series of values, filtered by a given value
 query listByPropertyMap(string className, struct propertyMap, boolean onlyRetrievePrimaryKey, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
          Lists values, filtered by a Struct of Property : Value properties
 query select(Object object, any key, [string lazyLoadName])
          Creates and runs the query for the TransferObject
private void setNullable(Nullable Nullable)
private void setSQLValue(SQLValue sqlValue)
private void setTransferDeleter(TransferDeleter TransferDeleter)
private void setTransferGateway(TransferGateway TransferGateway)
private void setTransferInserter(TransferInserter TransferInserter)
private void setTransferRefresher(TransferRefresher TransferRefresher)
private void setTransferSelecter(TransferSelecter TransferSelecter)
private void setTransferUpdater(TransferUpdater TransferUpdater)
 void update(TransferObject transfer, boolean useTransaction)
          Updates the Transfer in the DB
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(SQLFactory sqlFactory)
Constructor

Parameters:
sqlFactory - the SQL factory implementation
Method Detail

create

public void create(TransferObject transfer, boolean useTransaction)
Inserts the transfer into the DB

Parameters:
transfer - The transfer object to insert
useTransaction - Whether or not to use an internal transaction block

delete

public void delete(TransferObject transfer, boolean useTransaction)
Deletes a transfer object

Parameters:
transfer - The transfer object to insert
useTransaction - Whether or not to use an internal transaction block

getInsertRefreshQuery

public query getInsertRefreshQuery(TransferObject transfer)
Returns the refresh query for an insert

Parameters:
transfer - The object to refresh

getNullable

public Nullable getNullable()


getPropertyColumnValue

public any getPropertyColumnValue(query query, Object object, Property property)
Returns the column value, but returns the default null value for the item if it is NULL

Parameters:
query - The query we are looking at
object - The property to get the value for
property - The property to get the value for

getSQLValue

private SQLValue getSQLValue()


getTransferDeleter

private TransferDeleter getTransferDeleter()


getTransferGateway

private TransferGateway getTransferGateway()


getTransferInserter

private TransferInserter getTransferInserter()


getTransferRefresher

private TransferRefresher getTransferRefresher()


getTransferSelecter

private TransferSelecter getTransferSelecter()


getTransferUpdater

private TransferUpdater getTransferUpdater()


getUpdateRefreshQuery

public query getUpdateRefreshQuery(TransferObject transfer)
Returns the refresh query for an insert

Parameters:
transfer - The object to refresh

hasInsertRefresh

public boolean hasInsertRefresh(TransferObject transfer)
Check to see if it requires a run of the refresh query

Parameters:
transfer - The object to refresh

hasUpdateRefresh

public boolean hasUpdateRefresh(TransferObject transfer)
Check to see if it requires a run of the refresh query

Parameters:
transfer - The object to refresh

list

public query list(string className, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
Lists a series of object values

Parameters:
className - The class of the objects to list
orderProperty - The property to order by
orderASC - Boolean whether to order by ASC, otherwise order by DESC
useAliases - Boolean as to whether or not to alias columns with the transfer property names

listByProperty

public query listByProperty(string className, string propertyName, any propertyValue, boolean onlyRetrievePrimaryKey, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
Lists a series of values, filtered by a given value

Parameters:
className - The class of the objects to list
propertyName - The name of the property to filter by
propertyValue - The value to filter by (only simple values)
onlyRetrievePrimaryKey - boolean to whether or not to only retrieve the primary key
orderProperty - The property to order by
orderASC - Boolean whether to order by ASC, otherwise order by DESC
useAliases - Boolean as to whether or not to alias columns with the transfer property names

listByPropertyMap

public query listByPropertyMap(string className, struct propertyMap, boolean onlyRetrievePrimaryKey, [string orderProperty=''], [boolean orderASC='true'], [boolean useAliases='true'])
Lists values, filtered by a Struct of Property : Value properties

Parameters:
className - The class of the objects to list
propertyMap - Struct with keys that match to properties, and values to filter by
onlyRetrievePrimaryKey - boolean to whether or not to only retrieve the primary key
orderProperty - The property to order by
orderASC - Boolean whether to order by ASC, otherwise order by DESC
useAliases - Boolean as to whether or not to alias columns with the transfer property names

select

public query select(Object object, any key, [string lazyLoadName])
Creates and runs the query for the TransferObject

Parameters:
object - The Object BO
key - The id key for the data
lazyLoadName - the name of the lazy load, if there is one, for locking and caching

setNullable

private void setNullable(Nullable Nullable)

Parameters:
Nullable

setSQLValue

private void setSQLValue(SQLValue sqlValue)

Parameters:
sqlValue

setTransferDeleter

private void setTransferDeleter(TransferDeleter TransferDeleter)

Parameters:
TransferDeleter

setTransferGateway

private void setTransferGateway(TransferGateway TransferGateway)

Parameters:
TransferGateway

setTransferInserter

private void setTransferInserter(TransferInserter TransferInserter)

Parameters:
TransferInserter

setTransferRefresher

private void setTransferRefresher(TransferRefresher TransferRefresher)

Parameters:
TransferRefresher

setTransferSelecter

private void setTransferSelecter(TransferSelecter TransferSelecter)

Parameters:
TransferSelecter

setTransferUpdater

private void setTransferUpdater(TransferUpdater TransferUpdater)

Parameters:
TransferUpdater

update

public void update(TransferObject transfer, boolean useTransaction)
Updates the Transfer in the DB

Parameters:
transfer - The transferObject to update
useTransaction - Whether or not to use an internal transaction block

Transfer version 1.1