DataFaucet 1.0 Beta

datafaucet.system.sql
Class select

WEB-INF.cftags.component
        extended by datafaucet.system.sql.duck
            extended by datafaucet.system.sql.simplefiltergroup
                extended by datafaucet.system.sql.filtergroup
                    extended by datafaucet.system.sql.statement
                        extended by datafaucet.system.sql.select

public class select
extends statement

creates a sql select statement which can be unioned, joined and filtered


Constructor Summary
init(string table, [string columns='*'], [string orderby=''], [string include='and'], [string groupby=''], [string having=''], [numeric maxrows='[runtime expression]'], [boolean sortLS='[runtime expression]'], [any datasource=''])
 
Method Summary
 any addColumns(string columnList, [string clause='select'], [boolean overwrite='false'], [boolean append='true'])
private any addLiquidJoin(string MissingMethodName, struct MissingMethodArguments)
private any addLiquidUnion(string MissingMethodName, struct MissingMethodArguments)
 any addSourceTable(any table, [string column=''], [string references=''])
 any cacheAfter(string cachename, string cachedafter)
          enables caching for the query object after a specified date
 any cacheWithin(string cachename, [string cachedwithin='1'], [string datepart='n'])
          enables caching for the query object within a specified period of time
 any clearJoinTables()
 query execute()
 struct getAllTables([struct tables='[runtime expression]'])
private any getCache()
private any getCacheManager()
private string getColumnList(string property)
private any getDataManager()
 any getDatasource()
 any getFirstJoin()
private any getForeignKey(string table, string source, string column)
 any getJoin([string table=''])
          searches join tables for a table matching a specified alias - returns 0 if no join table is found
private string getQualifiedColumns(string property)
 any getSourceTables()
 string getSyntax()
private any getTableFromMethodName(string name)
private string get_alias()
private any get_cachedafter()
private string get_columns()
 any get_distinct(string propertyname)
          returns the distinct value for the current select statement - allows joined tables to reflect the value for the entire statement
private string get_groupby()
private string get_having()
private string get_orderby()
private string get_select()
 boolean hasJoinSource()
 boolean hasJoinTables()
 boolean isRequired()
 any join(string table, [boolean required='false'], [string column=''], [string references=''], [string include='and'], [string select=''], [string orderby=''], [string groupby=''], [string having=''])
private any matchTable(any table, string isMatchFor)
 any onMissingMethod(string MissingMethodName, struct MissingMethodArguments)
          Handles missing method exceptions.
 any purge()
          purges the cache for this statement
private any setCache(query query)
 any setCacheManager(any CacheManager)
 any setFirstJoin(any join)
private void set_all(string propertyname, boolean propertyvalue)
private any set_cachedafter(string propertyname, string propertyvalue)
private any set_cachedwithin(string propertyname, string propertyvalue)
private any set_cachename(string propertyname, string propertyvalue)
private void set_columns(string propertyname, string propertyvalue)
private any set_datepart(string propertyname, string propertyvalue)
 any set_distinct(string propertyname, boolean propertyvalue)
          this method ensures that the distinct property is a boolean value
private any set_maxrows(string propertyname, string propertyvalue)
private any set_sort(string propertyname, string propertyvalue)
 any sort(string columns)
          sets the sort property to override the default sort-order in the orderby property
private query sortLS(query qry)
 any union(string table, string columns, [boolean all='false'], [string include='and'], [string groupby=''], [string having=''])
 
Methods inherited from class datafaucet.system.sql.statement
addListener, bindFilters, broadcast, clearListeners, clearUnions, getColumns, getGroupSource, getListeners, getNewListener, getSQLAgent, getSource, getSourceName, getTable, hasFilters, hasGroupSource, hasListeners, initStatement, notifyListener, reset, setDatasource, set_datasource, set_table
 
Methods inherited from class datafaucet.system.sql.filtergroup
addLiquidFilterGroup, addLiquidFilters, andOrCollectionFilter, andOrFilter, caseSensitiveFilter, collectionFilter, dateFilter, filter, filterGroup, filterLanguage, filterLocale, getDefaultLocale, getLiquidNameArray, getLocaleArray, getNewFilter, listFilter, nullFilter, numericFilter, reverseFilter, setFirstFilter, sqlFilter, timeSpanFilter
 
Methods inherited from class datafaucet.system.sql.simplefiltergroup
appendFilter, clearFilters, columnNotFoundException, filtersExist, getAvailableColumnList, getFilters, getFirstFilter, getTableArray, getTableForColumn, get_column, isGroup, makeFilters, raiseFilterExceptions, setTable, typeMismatchException
 
Methods inherited from class datafaucet.system.sql.duck
arg, getDefaultLocalization, getLocalization, getNext, getObject, getProperties, getProperty, getPropertylist, getTail, getValue, hasNext, identifyAccessorOrMutator, insertAfter, parseDate, parseNumber, raiseAbstractClassException, raiseMissingMethodException, removeAfter, setLocalization, setNext, setProperties, setProperty, setValue, simplify
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(string table, [string columns='*'], [string orderby=''], [string include='and'], [string groupby=''], [string having=''], [numeric maxrows='[runtime expression]'], [boolean sortLS='[runtime expression]'], [any datasource=''])

Parameters:
table - the database table to insert a record into
columns - the list of columns to retreive from the datasource - use || to concatenate column names in this select across all db server platforms
orderby - a list of columns to order the query - WARNING: DO NOT allow users to provide this value -- allow users to provide the sort property instead
include - and / or -- determines whether the filters are cumulative or exclusive
groupby - a list of columns to group the query by -- required by the db server when aggregated columns are in the select select - a regular expression is applied to the default to eliminate "asc" and "desc" from the group by clause
having - allows the application of a having clause in the sql syntax
maxrows - allows the query to be limited to a specified number of records
sortLS - indicates if the result query should be locale-specific sorted after execution
datasource
Method Detail

addColumns

public any addColumns(string columnList, [string clause='select'], [boolean overwrite='false'], [boolean append='true'])

Parameters:
columnList
clause
overwrite
append

addLiquidJoin

private any addLiquidJoin(string MissingMethodName, struct MissingMethodArguments)

Parameters:
MissingMethodName - The name of the missing method.
MissingMethodArguments - The arguments that were passed to the missing method. This might be a named argument set or a numerically indexed set.

addLiquidUnion

private any addLiquidUnion(string MissingMethodName, struct MissingMethodArguments)

Parameters:
MissingMethodName - The name of the missing method.
MissingMethodArguments - The arguments that were passed to the missing method. This might be a named argument set or a numerically indexed set.

addSourceTable

public any addSourceTable(any table, [string column=''], [string references=''])

Parameters:
table
column - the name of the target column in the joined table
references - the name of the source column in the table being adjoined

cacheAfter

public any cacheAfter(string cachename, string cachedafter)
enables caching for the query object after a specified date

Parameters:
cachename
cachedafter

cacheWithin

public any cacheWithin(string cachename, [string cachedwithin='1'], [string datepart='n'])
enables caching for the query object within a specified period of time

Parameters:
cachename
cachedwithin
datepart

clearJoinTables

public any clearJoinTables()

Overrides:
clearJoinTables in class statement

execute

public query execute()

Overrides:
execute in class statement

getAllTables

public struct getAllTables([struct tables='[runtime expression]'])

Parameters:
tables

getCache

private any getCache()


getCacheManager

private any getCacheManager()


getColumnList

private string getColumnList(string property)

Overrides:
getColumnList in class statement
Parameters:
property

getDataManager

private any getDataManager()


getDatasource

public any getDatasource()

Overrides:
getDatasource in class statement

getFirstJoin

public any getFirstJoin()


getForeignKey

private any getForeignKey(string table, string source, string column)

Parameters:
table
source
column

getJoin

public any getJoin([string table=''])
searches join tables for a table matching a specified alias - returns 0 if no join table is found

Parameters:
table

getQualifiedColumns

private string getQualifiedColumns(string property)

Parameters:
property

getSourceTables

public any getSourceTables()


getSyntax

public string getSyntax()

Overrides:
getSyntax in class statement

getTableFromMethodName

private any getTableFromMethodName(string name)

Parameters:
name

get_alias

private string get_alias()

Overrides:
get_alias in class statement

get_cachedafter

private any get_cachedafter()


get_columns

private string get_columns()


get_distinct

public any get_distinct(string propertyname)
returns the distinct value for the current select statement - allows joined tables to reflect the value for the entire statement

Parameters:
propertyname

get_groupby

private string get_groupby()


get_having

private string get_having()


get_orderby

private string get_orderby()


get_select

private string get_select()


hasJoinSource

public boolean hasJoinSource()

Overrides:
hasJoinSource in class simplefiltergroup

hasJoinTables

public boolean hasJoinTables()

Overrides:
hasJoinTables in class statement

isRequired

public boolean isRequired()


join

public any join(string table, [boolean required='false'], [string column=''], [string references=''], [string include='and'], [string select=''], [string orderby=''], [string groupby=''], [string having=''])

Parameters:
table - the name of the table to join to theq uery
required - indicates if records in the joined table are required to return records in the source table -- an outer join is created when false and an inner join is created when true
column - the name of the target column in the joined table
references - the name of the source column in the table being adjoined
include - and / or -- if multiple join tags are applied with the same table this attribute determines if the joins are exclusive or inclusive
select - allows select columns to be placed in the join table so that they are removed with the join if the join is removed
orderby - allows order columns to be placed in the join table so that they are removed with the join if the join is removed
groupby - allows order columns to be placed in the join table so that they are removed with the join if the join is removed
having - allows order columns to be placed in the join table so that they are removed with the join if the join is removed

matchTable

private any matchTable(any table, string isMatchFor)

Parameters:
table
isMatchFor

onMissingMethod

public any onMissingMethod(string MissingMethodName, struct MissingMethodArguments)
Handles missing method exceptions.

Overrides:
onMissingMethod in class filtergroup
Parameters:
MissingMethodName - The name of the missing method.
MissingMethodArguments - The arguments that were passed to the missing method. This might be a named argument set or a numerically indexed set.

purge

public any purge()
purges the cache for this statement


setCache

private any setCache(query query)

Parameters:
query

setCacheManager

public any setCacheManager(any CacheManager)

Parameters:
CacheManager

setFirstJoin

public any setFirstJoin(any join)

Parameters:
join

set_all

private void set_all(string propertyname, boolean propertyvalue)

Parameters:
propertyname
propertyvalue

set_cachedafter

private any set_cachedafter(string propertyname, string propertyvalue)

Parameters:
propertyname
propertyvalue

set_cachedwithin

private any set_cachedwithin(string propertyname, string propertyvalue)

Parameters:
propertyname
propertyvalue

set_cachename

private any set_cachename(string propertyname, string propertyvalue)

Parameters:
propertyname
propertyvalue

set_columns

private void set_columns(string propertyname, string propertyvalue)

Parameters:
propertyname
propertyvalue

set_datepart

private any set_datepart(string propertyname, string propertyvalue)

Parameters:
propertyname
propertyvalue

set_distinct

public any set_distinct(string propertyname, boolean propertyvalue)
this method ensures that the distinct property is a boolean value

Parameters:
propertyname
propertyvalue

set_maxrows

private any set_maxrows(string propertyname, string propertyvalue)

Parameters:
propertyname
propertyvalue

set_sort

private any set_sort(string propertyname, string propertyvalue)

Parameters:
propertyname
propertyvalue

sort

public any sort(string columns)
sets the sort property to override the default sort-order in the orderby property

Parameters:
columns

sortLS

private query sortLS(query qry)

Parameters:
qry

union

public any union(string table, string columns, [boolean all='false'], [string include='and'], [string groupby=''], [string having=''])

Parameters:
table - the database table to insert a record into
columns - the list of columns to retreive from the datasource - use || to concatenate column names in this select across all db server platforms
all - indicates if the all keyword should be used when the union is applied
include - and / or -- determines whether the filters are cumulative or exclusive
groupby - a list of columns to group the query by -- required by the db server when aggregated columns are in the select select - a regular expression is applied to the default to eliminate "asc" and "desc" from the group by clause
having - allows the application of a having clause in the sql syntax

DataFaucet 1.0 Beta