Transfer version 1.1

transfer.com.tql.walkers
Class SelectColumn

WEB-INF.cftags.component
        extended by transfer.com.tql.walkers.AbstractBaseWalker
            extended by transfer.com.tql.walkers.SelectColumn

public class SelectColumn
extends AbstractBaseWalker

Resolves select columns


Method Summary
private void appendSelectColumnToBuffer(string tableName, Property property, any buffer, boolean isFirstColumn, boolean aliasColumns, any usedColumnAliases)
          appends the neccessary column values to the buffer for a property
 array evaluateSelectAST(any tree, struct aliasMap, array evaluation, any buffer, boolean aliasColumns, boolean distinctMode, [any selectAST=''], [any usedColumnAliases='[runtime expression]'])
          walks the tree, and makes a array of structs that represent the Select SQL and the mapped values
 void evaluateSelectColumnPrimaryKey(string className, struct aliasMap, any buffer, boolean aliasColumns, boolean distinctMode)
          evaluates a single column that is the primary key of the class
 struct evaluateSelectColumnsFromAST(any tree, array evaluation, any buffer, boolean aliasColumns, boolean distinctMode, [any isFirstColumn='[runtime expression]'], [any usedColumnAliases='[runtime expression]'], [boolean ignoreSelect='false'])
          builds a list of select columns from the fromAST
private void writeCompositeKeyColumnsToSelectColumn(any buffer, CompositeKey primaryKey)
          writes all the composite keys to the select columns
 
Methods inherited from class transfer.com.tql.walkers.AbstractBaseWalker
getJoin, getObject, getObjectManager, getProperty, getSelectStatement, getTQLParser, init, setJoin, setObject, setObjectManager, setProperty, setSelectStatement, setTQLParser, throw
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(TQLParser tqlParser, ObjectManager objectManager, [Property property], [Object object], [Join join], [SelectStatement selectStatement])
Constructor

Parameters:
tqlParser - The tqlParser to generate the AST for the TQL
objectManager - The object manager to query
property - property walker
object - Object walker
join - join walker
selectStatement - Select statement for sub selects
Method Detail

appendSelectColumnToBuffer

private void appendSelectColumnToBuffer(string tableName, Property property, any buffer, boolean isFirstColumn, boolean aliasColumns, any usedColumnAliases)
appends the neccessary column values to the buffer for a property

Parameters:
tableName - the name of the table
property - the property to build the select from
buffer - java.lang.StringBuffer for preSQL building
isFirstColumn - If its the first column or not
aliasColumns - to alias columns or not
usedColumnAliases - java.util.ArrayList:The column aliases that have already been used

evaluateSelectAST

public array evaluateSelectAST(any tree, struct aliasMap, array evaluation, any buffer, boolean aliasColumns, boolean distinctMode, [any selectAST=''], [any usedColumnAliases='[runtime expression]'])
walks the tree, and makes a array of structs that represent the Select SQL and the mapped values

Parameters:
tree - The tree node to walk
aliasMap - The from map
evaluation - The array of evaluated values
buffer - java.lang.StringBuffer for preSQL building
aliasColumns - to alias columns or not
distinctMode - If to make the select distinct or not
selectAST - Storage for the top level, select AST, for asterisks
usedColumnAliases - java.util.ArrayList:The column aliases that have already been used

evaluateSelectColumnPrimaryKey

public void evaluateSelectColumnPrimaryKey(string className, struct aliasMap, any buffer, boolean aliasColumns, boolean distinctMode)
evaluates a single column that is the primary key of the class

Parameters:
className - The class to retrieve the primary key from
aliasMap - The from map
buffer - java.lang.StringBuffer for preSQL building
aliasColumns - to alias columns or not
distinctMode - If to make the select distinct or not

evaluateSelectColumnsFromAST

public struct evaluateSelectColumnsFromAST(any tree, array evaluation, any buffer, boolean aliasColumns, boolean distinctMode, [any isFirstColumn='[runtime expression]'], [any usedColumnAliases='[runtime expression]'], [boolean ignoreSelect='false'])
builds a list of select columns from the fromAST

Parameters:
tree - The tree node to walk
evaluation - The array of evaluated values
buffer - java.lang.StringBuffer for preSQL building
aliasColumns - to alias columns or not
distinctMode - If to make the select distinct or not
isFirstColumn - java.lang.Boolean: is it the first column
usedColumnAliases - java.util.ArrayList:The column aliases that have already been used
ignoreSelect - whether or not to display the select clause

writeCompositeKeyColumnsToSelectColumn

private void writeCompositeKeyColumnsToSelectColumn(any buffer, CompositeKey primaryKey)
writes all the composite keys to the select columns

Parameters:
buffer - java.lang.StringBuffer for preSQL building
primaryKey - the composite primary key

Transfer version 1.1