|
Transfer version 1.1 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
transfer.com.sql.AbstractBaseTransfer
transfer.com.sql.TransferInserter
public class TransferInserter
Inserts a transfer's details into the DB
| Constructor Summary | |
|---|---|
init(Datasource datasource, ObjectManager objectManager, XMLFileReader xmlFileReader, Utility utility, Nullable nullable, QueryExecutionPool queryExecutionPool, QueryCache queryCache, Transaction transaction)
Constructor |
|
| Method Summary | |
|---|---|
private Query |
buildInsertBasicQuery(TransferObject transfer, boolean primaryKeyHasValue, string generateKey, boolean populatePrimaryKey)
builds a basic query |
Query |
buildInsertManyToMany(Object object, ManyToMany manytomany)
builds tehe query for inserting a many to many |
private any |
buildSQLBeforeInsert(Object object)
Overwrite to run SQL directly before the insert query (no generation). Should select a 'id' column for id population |
private void |
buildSqlInsideInsert(Query query, Object object)
Overwrite method to run SQL inside the insert query (with no generation), and before the end of the cfquery block. Should select a 'id' column for id population |
private any |
buildsqlAfterInsert(Object object)
Overwrite to run SQL directly after the insert query (no generation). Should select a 'id' column for id population |
void |
create(TransferObject transfer, boolean useTransaction)
Inserts the transfer into the DB |
private string |
createColumnList(Object object, boolean primaryKeyHasValue, string generateKey)
Creates the column list to insert |
private any |
executeBasicInsert(TransferObject transfer, Query query, boolean primaryKeyHasValue, string generateKey, boolean populatePrimaryKey)
executes the basic insert |
private IDGenerator |
getIDGenerator()
|
private Nullable |
getNullable()
|
private void |
insertBasic(TransferObject transfer)
Insert the single table part of the query. populates the transfer with it's primary key |
private void |
insertBlock(TransferObject transfer)
run the insert |
private void |
insertManyToMany(TransferObject transfer)
Updates the many to many portion of the transfer |
private void |
invokeSetPrimaryKey(TransferObject transfer, string primarykeyvalue)
Invokes the setPrimaryKey method on the transfer object |
private boolean |
primaryKeyHasValue(TransferObject transfer)
Checks to see if the object's primary key has a value other than default |
private void |
setGeneratedPrimaryKey(TransferObject transfer)
sets the TransferObject's primary key value with one generated by Transfer |
private void |
setIDGenerator(IDGenerator IDGenerator)
|
private void |
setNullable(Nullable Nullable)
|
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init(Datasource datasource, ObjectManager objectManager, XMLFileReader xmlFileReader, Utility utility, Nullable nullable, QueryExecutionPool queryExecutionPool, QueryCache queryCache, Transaction transaction)
datasource - The datasource BOobjectManager - Need to object manager for making queriesxmlFileReader - The file path to the config fileutility - The utility classnullable - The nullable classqueryExecutionPool - the query execution poolqueryCache - the query object cachetransaction| Method Detail |
|---|
private Query buildInsertBasicQuery(TransferObject transfer, boolean primaryKeyHasValue, string generateKey, boolean populatePrimaryKey)
transfer - The transfer object to insertprimaryKeyHasValue - whether the primary key already has a valuegenerateKey - whether or not to generate a keypopulatePrimaryKey - whether or not to populate the primary key with a valuepublic Query buildInsertManyToMany(Object object, ManyToMany manytomany)
object - the object that the insert is formanytomany - the many to many that is being insertedprivate any buildSQLBeforeInsert(Object object)
object - The object that is being insertedprivate void buildSqlInsideInsert(Query query, Object object)
query - the query objectobject - The oject that is being insertedprivate any buildsqlAfterInsert(Object object)
object - The oject that is being insertedpublic void create(TransferObject transfer, boolean useTransaction)
transfer - The transfer object to insertuseTransaction - Whether or not to use an internal transaction blockprivate string createColumnList(Object object, boolean primaryKeyHasValue, string generateKey)
object - The oject that is being insertedprimaryKeyHasValue - Pass through if the primary key has value alreadygenerateKey - whether or not to generate a keyprivate any executeBasicInsert(TransferObject transfer, Query query, boolean primaryKeyHasValue, string generateKey, boolean populatePrimaryKey)
transfer - The transfer object to insertquery - The query to executeprimaryKeyHasValue - whether the primary key already has a valuegenerateKey - whether or not to generate a keypopulatePrimaryKey - whether or not to populate the primary key with a valueprivate IDGenerator getIDGenerator()
private Nullable getNullable()
private void insertBasic(TransferObject transfer)
transfer - The transfer object to insertprivate void insertBlock(TransferObject transfer)
transfer - The transfer object to insertprivate void insertManyToMany(TransferObject transfer)
transfer - The transferObject to updateprivate void invokeSetPrimaryKey(TransferObject transfer, string primarykeyvalue)
transfer - The transfer object to insertprimarykeyvalue - The primary key valueprivate boolean primaryKeyHasValue(TransferObject transfer)
transfer - The transfer objectprivate void setGeneratedPrimaryKey(TransferObject transfer)
transfer - The transfer object to insertprivate void setIDGenerator(IDGenerator IDGenerator)
IDGeneratorprivate void setNullable(Nullable Nullable)
Nullable
|
Transfer version 1.1 | ||||
| FRAMES | |||||