|
Transfer version 1.1 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
transfer.com.sql.AbstractBaseTransfer
transfer.com.sql.TransferSelecter
public class TransferSelecter
Selects the data for a Transfer Object
| Constructor Summary | |
|---|---|
init(Datasource datasource, ObjectManager objectManager, TQLConverter tQLConverter, QueryExecutionPool queryExecutionPool, QueryCache queryCache, Transaction transaction)
Constructor |
|
| Method Summary | |
|---|---|
private string |
appendCollectionColumn(struct columnStruct, Object object, Collection collection)
appends a collection column if it has a key or an order. returns the property name, if one is added, otherwise return '' |
private void |
appendCompositeKeyForeignKeys(Object object, struct columnStruct)
appending composite foreign keys to the object, particularly for lazy loading |
private void |
appendCompositeKeyValue(any buffer, string table, string column)
appends the composite key value to the buffer |
private void |
appendProxiedColumns(struct columnStruct, Object object)
add the columns we need for proxied collections for ordering and struct values, and composite keys |
private struct |
buildColumnStruct(Object object, [boolean lazyLoaded='false'], [struct columnStruct='[runtime expression]'], [array visitedClasses='[runtime expression]'], [string compositionName=''], [boolean proxied='false'])
Builds an struct with a key on table, with an array inside of each column, with type and column |
private string |
buildCompositeKeyValue(string tableName, Object object)
builds the sql for a composite parent key |
private string |
buildConditionSQL(Object object, Condition condition, numeric orderIndex)
Builds the where statement for a condition |
private string |
buildInitialFromSQL(Object object)
Builds the initial from SQL |
private string |
buildManyToManyFromSQL(Object object, Object composite, ManyToMany manyToMany, string fromSQL, numeric orderIndex)
Builds the from SQL from a many to many composition |
private string |
buildManyToOneFromSQL(Object object, Object composite, ManyToOne manyToOne, string fromSQL, numeric orderIndex)
Builds the from SQL for many to one composition |
private string |
buildOneToManyFromSQL(Object object, Object composite, OneToMany oneToMany, string fromSQL, numeric orderIndex)
Builds the from SQL for a One to Many SQL |
private string |
buildOrder(any orderBuffer, Collection collection, Object object)
Builds the ORDER BY part of the sql |
private Query |
buildSQL(Object object, Query query, struct columnStruct, string fromSQL, [string whereSQL=''], [Object originalObject='[runtime expression]'], [string parentCompositeName=''], [Object parentObject='[runtime expression]'], [string parentParentClass=''], [array visitedClasses='[runtime expression]'], [numeric orderIndex='1'], [string compositeName=''], [boolean isArray='false'], [any orderBuffer='[runtime expression]'], [boolean hasCompositeID='[runtime expression]'], [boolean isProxied='false'])
Builds the SQL via a stringBuffer |
private void |
buildSelect(Query query, Object object, Object parentObject, struct columnStruct, numeric orderIndex, boolean hasCompositeID)
Builds the column list part of the SELECT for a given object |
private Query |
buildSelectSQL(Object object, [string lazyLoadName])
Creates the SQL for the Object BO |
private boolean |
concatSeperator(any buffer, boolean isFirst)
seperates values with commas |
private boolean |
containsCompositeID(Object object, [array visitedClasses='[runtime expression]'])
do I have a composite id inside the object |
private struct |
createColumnMeta(Property property, [string column='[runtime expression]'])
Builds the Column meta data. Struct returned with column name (column), and type (type) |
private string |
createTableName(any object, numeric orderIndex)
Creates a table name from the table and hte orderindex |
private array |
flattenColumnStruct(struct columnStruct)
returns a flat array of column names, without duplicates |
private TQLConverter |
getTQLConverter()
|
query |
select(Object object, any key, [string lazyLoadName])
read the object data from the DB, and return it |
private void |
setRequiredProperty(struct args, boolean isProxied, Collection collection)
sets the required property argument |
private void |
setTQLConverter(TQLConverter TQLConverter)
|
private boolean |
tableContainsColumnName(array table, string column)
if the table contains this column |
private any |
throw(string type, string message, [string detail=''])
Throws an Exception |
private string |
writeConcat()
writes concat seperator |
private string |
writeEndConcat()
writes the end concat seperator |
private string |
writeNULL(string column, string type)
Overwrite to implement database specific NULL string text. |
private string |
writeStartConcat()
writes the start concat seperator |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init(Datasource datasource, ObjectManager objectManager, TQLConverter tQLConverter, QueryExecutionPool queryExecutionPool, QueryCache queryCache, Transaction transaction)
datasource - The datasource BOobjectManager - Need to object manager for making queriestQLConverter - Converter for {property} statementsqueryExecutionPool - the query execution poolqueryCache - the query object cachetransaction| Method Detail |
|---|
private string appendCollectionColumn(struct columnStruct, Object object, Collection collection)
columnStruct - Struct of Arrays defining tables and their columnsobject - The BO of the object to build the list tocollection - the collection meta dataprivate void appendCompositeKeyForeignKeys(Object object, struct columnStruct)
object - The BO of the object to build the list tocolumnStruct - Struct of Arrays defining tables and their columnsprivate void appendCompositeKeyValue(any buffer, string table, string column)
buffer - the string buffertable - the name of the tablecolumn - the column to addprivate void appendProxiedColumns(struct columnStruct, Object object)
columnStruct - Struct of Arrays defining tables and their columnsobject - The BO of the object to build the list toprivate struct buildColumnStruct(Object object, [boolean lazyLoaded='false'], [struct columnStruct='[runtime expression]'], [array visitedClasses='[runtime expression]'], [string compositionName=''], [boolean proxied='false'])
object - The BO of the object to build the list tolazyLoaded - if the SQL is for a lazy populatecolumnStruct - Struct of Arrays defining tables and their columnsvisitedClasses - Array of class names that have been visitedcompositionName - The name of the compositionproxied - whether or not the data is being proxiedprivate string buildCompositeKeyValue(string tableName, Object object)
tableName - the name of the table to build againstobject - the parent objectprivate string buildConditionSQL(Object object, Condition condition, numeric orderIndex)
object - The Object that is being created in the collectioncondition - The conditionorderIndex - The order indexprivate string buildInitialFromSQL(Object object)
object - The BO of the object to build FROM fromprivate string buildManyToManyFromSQL(Object object, Object composite, ManyToMany manyToMany, string fromSQL, numeric orderIndex)
object - The original objectcomposite - The composite objectmanyToMany - The many to many connectorfromSQL - The from SQL already writtenorderIndex - The order index of this selectprivate string buildManyToOneFromSQL(Object object, Object composite, ManyToOne manyToOne, string fromSQL, numeric orderIndex)
object - The original objectcomposite - The composite objectmanyToOne - The many to many connectorfromSQL - The from SQL already writtenorderIndex - The order index of this selectprivate string buildOneToManyFromSQL(Object object, Object composite, OneToMany oneToMany, string fromSQL, numeric orderIndex)
object - The original objectcomposite - The composite objectoneToMany - The one to many connectorfromSQL - The from SQL already writtenorderIndex - The order index of this selectprivate string buildOrder(any orderBuffer, Collection collection, Object object)
orderBuffer - The java.util.StringBuffer for order byscollection - The collection that is being createdobject - The Object that is being created in the collectionprivate Query buildSQL(Object object, Query query, struct columnStruct, string fromSQL, [string whereSQL=''], [Object originalObject='[runtime expression]'], [string parentCompositeName=''], [Object parentObject='[runtime expression]'], [string parentParentClass=''], [array visitedClasses='[runtime expression]'], [numeric orderIndex='1'], [string compositeName=''], [boolean isArray='false'], [any orderBuffer='[runtime expression]'], [boolean hasCompositeID='[runtime expression]'], [boolean isProxied='false'])
object - The BO of the object to build the list toquery - the query objectcolumnStruct - Struct of Arrays that defines tables and columnsfromSQL - String that contains the from statementwhereSQL - The WHERE clause of the SQLoriginalObject - the original object being searched forparentCompositeName - The paren't composite nameparentObject - The parent object to set the item toparentParentClass - parent class 2 levels upvisitedClasses - Array of class names that have been visitedorderIndex - The order index of this selectcompositeName - The name of the composite structureisArray - is this memento part of an array?orderBuffer - java.land.StringBuffer that tracks order by statementhasCompositeID - whether there is a composite id in the treeisProxied - whether or not it is proxiedprivate void buildSelect(Query query, Object object, Object parentObject, struct columnStruct, numeric orderIndex, boolean hasCompositeID)
query - The sql query objectobject - The BO of the object to build the list toparentObject - The parent object to set the item tocolumnStruct - Struct of Arrays defining the columnsorderIndex - The order index of this selecthasCompositeID - if it has a composite id in the treeprivate Query buildSelectSQL(Object object, [string lazyLoadName])
object - The Object BOlazyLoadName - the name of the lazy load, if there is one, for locking and cachingprivate boolean concatSeperator(any buffer, boolean isFirst)
buffer - the stringbuffer object objectisFirst - if this is the first request to for the commaprivate boolean containsCompositeID(Object object, [array visitedClasses='[runtime expression]'])
object - The BO of the object to build the list tovisitedClasses - Array of class names that have been visitedprivate struct createColumnMeta(Property property, [string column='[runtime expression]'])
property - The property to get the type fromcolumn - The column to setprivate string createTableName(any object, numeric orderIndex)
object - The object whose table we needorderIndex - The order Indexprivate array flattenColumnStruct(struct columnStruct)
columnStruct - Struct of Arrays defining the columnsprivate TQLConverter getTQLConverter()
public query select(Object object, any key, [string lazyLoadName])
object - The Object BOkey - The id key for the datalazyLoadName - the name of the lazy load, if there is one, for locking and cachingprivate void setRequiredProperty(struct args, boolean isProxied, Collection collection)
args - the argument collectionisProxied - whether or not the composition is proxiedcollection - the collection to look atprivate void setTQLConverter(TQLConverter TQLConverter)
TQLConverterprivate boolean tableContainsColumnName(array table, string column)
table - the table meta datacolumn - the name of the columnprivate any throw(string type, string message, [string detail=''])
throw
in class
AbstractBaseTransfer
type - The type of exceptionmessage - The message to accompany the exceptiondetail - The detail message for the exceptionprivate string writeConcat()
private string writeEndConcat()
private string writeNULL(string column, string type)
column - The column to write the 'NULL' fortype - The type to write the 'NULL' forprivate string writeStartConcat()
|
Transfer version 1.1 | ||||
| FRAMES | |||||