DataFaucet 1.0 Beta

datafaucet.system
Class datasource

WEB-INF.cftags.component
        extended by datafaucet.system.kernel
            extended by datafaucet.system.duck
                extended by datafaucet.system.datasource

public class datasource
extends duck

This component encapsulates common functionality for a given datasource


Constructor Summary
init([string datasource=''], [string server=''], [string description=''], [string catalog=''], [string schema=''], [string usr=''], [string pwd=''], [string version=''])
 
Method Summary
 string ParseDDL(any xml, [boolean execute='true'])
 any delete(string table, any id, [string column=''])
private any fetchServerType()
 any getActiveRecord([string table=''], [string objectid=''], [string className='activerecord'], [struct columns='[runtime expression]'])
private any getAgentLocator()
 any getCacheManager()
 query getCatalogs()
 string getColumnList(string table, [string prefix='alias'], [string alias=''], [string omit=''])
          returns a comma delimited list of qualified column names in a specified table with optional additional formatting
 query getColumns(string table)
          gets columns for a specified table
private any getDataManager()
 string getDefaultCatalog()
 any getDefaultLocalization()
 any getDelete(string table, any id, [string column=''])
 struct getEntity(string entity)
 query getExportedKeys(string table)
          gets a list of tables into which the primary keys of the specified table are imported
private any getForeignKey(string table, string source, string column, [boolean returnprimary='true'])
 struct getForeignKeys(string table)
          gets imported foreign keys for a specified table as a structure
 any getGateway([string table=''], [string orderby=''], [string columns='*'], [string className='gateway'])
 query getImportedKeys(string table)
          returns primary keys that have been imported into a specified table
 any getInsert(string table, [struct insertData='[runtime expression]'])
 any getLocalization()
private any getMissingMethodParser()
 string getNextFromSequence(string sequence)
 query getParameters(string procedure)
          returns parameters for a specified stored procedure
private any getPrimaryKeyColumn(string table)
 query getPrimaryKeys(string table)
          gets primary key constraints for a specified table
 any getProcedure()
          returns an instantiated sql.procedure object
 struct getReferenceColumns(string targetTable, string sourceTable, [string column=''], [string references=''])
          returns default column names for a join clause based on foreign key constraints or conventions if no constraints are available
private struct getReferenceKeys(string targetTable, string sourceTable, [string column=''], [string references=''])
          returns default column names for a join clause based on foreign key constraints or conventions if no constraints are available
 any getSQLAgent()
          returns an instantiated SQL Agent CFC which can execute statements associated with this datasource
 any getSchemaExport([string exportclass='schemaexport'])
 query getSchemas()
 any getSelect([string columns='*'], string table, [string orderby=''], [string groupby=''], [string having=''], [numeric maxrows='-1'])
private any getSources()
 any getStatement(string type='select')
          returns an instantiated sql.statement object of a specified type (select|insert|update|delete)
 query getStoredProcedures([string procNames='%'])
          lists all stored procedures in the catalog
 query getTables([string tableNames='%'], [string types='table,view'])
          gets a list of views and/or tables in the catalog
 any getTransaction([string className='transaction'])
 any getUpdate(string table, [struct insertData='[runtime expression]'], [any column=''])
 any getValidator()
 boolean hasColumn(string entity, string column)
 boolean hasConstraint(string entity, string constraint)
 boolean hasProcedure(string entity)
 boolean hasSequence(string entity)
 boolean hasTable(string entity)
 boolean hasTableOrView(string entity)
 boolean hasTrigger(string entity, string trigger)
 boolean hasView(string entity)
 any isLoaded()
 string jdbcType(string type)
 any metadata()
          executes the JDBC metadata object for this datasource
 string newID([any ActiveRecord=''])
 any onMissingMethod(string MissingMethodName, struct MissingMethodArguments)
          Handles missing method exceptions.
private any parseDynamicSelect(string MissingMethodName, struct MissingMethodArguments)
 any purge()
          purges cached queries for this database - does not affect cached metadata
private any raiseSloppyException(string type, string table)
 any reset()
          purges cached metadata and queries for this database
 query select([string columns='*'], string table, [struct filters='[runtime expression]'], [string orderby=''], [numeric maxrows='-1'], [boolean distinct='false'])
 any setCacheManager(any CacheManager)
 any setLocalization(any localization)
 any setSources(any sources)
private any sqlInsert(string table, struct insertData)
 struct update(string table, struct insertData, [any column=''])
 
Methods inherited from class datafaucet.system.duck
addObserver, getObservers, getProperties, getProperty, getPropertylist, getValue, identifyAccessorOrMutator, observe, raiseMissingMethodException, setProperties, setProperty, setValue
 
Methods inherited from class datafaucet.system.kernel
arg, componentExists, getDataFaucet, getFaucetObject, getFile, getFileModified, getObject, getPlumbing, getTransactionManager, newTransaction, parseDate, setTransaction
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init([string datasource=''], [string server=''], [string description=''], [string catalog=''], [string schema=''], [string usr=''], [string pwd=''], [string version=''])

Parameters:
datasource - the dsn in the ColdFusion administrator for use in cfquery tags
server - the tokenized name of the database software used for this datasource
description - a human-readable description of the specified datasource
catalog - indicates the default catalog for this datasource - overrides the default catalog in the ColdFusion Administrator
schema - indicates the default schema for this datasource
usr - the username to associate with this datasource
pwd - the password associated with the specified username
version - the version associated with the specified server
Method Detail

ParseDDL

public string ParseDDL(any xml, [boolean execute='true'])

Parameters:
xml
execute

delete

public any delete(string table, any id, [string column=''])

Parameters:
table
id - string or struct
column - defaults to primary key

fetchServerType

private any fetchServerType()


getActiveRecord

public any getActiveRecord([string table=''], [string objectid=''], [string className='activerecord'], [struct columns='[runtime expression]'])

Parameters:
table
objectid
className
columns

getAgentLocator

private any getAgentLocator()


getCacheManager

public any getCacheManager()


getCatalogs

public query getCatalogs()


getColumnList

public string getColumnList(string table, [string prefix='alias'], [string alias=''], [string omit=''])
returns a comma delimited list of qualified column names in a specified table with optional additional formatting

Parameters:
table - the name of a table from which to fetch column names
prefix - indicates what portion of the table name should be included in the identifier for each column
alias - a value to prepend to the name of each column
omit - a list of columns to exclude from the returned list

getColumns

public query getColumns(string table)
gets columns for a specified table

Parameters:
table - the name of the table to return column data from

getDataManager

private any getDataManager()


getDefaultCatalog

public string getDefaultCatalog()


getDefaultLocalization

public any getDefaultLocalization()


getDelete

public any getDelete(string table, any id, [string column=''])

Parameters:
table
id - string or struct
column - defaults to primary key

getEntity

public struct getEntity(string entity)

Parameters:
entity

getExportedKeys

public query getExportedKeys(string table)
gets a list of tables into which the primary keys of the specified table are imported

Parameters:
table - the name of the table to return key data from

getForeignKey

private any getForeignKey(string table, string source, string column, [boolean returnprimary='true'])

Parameters:
table
source
column
returnprimary

getForeignKeys

public struct getForeignKeys(string table)
gets imported foreign keys for a specified table as a structure

Parameters:
table - the name of the table to return key data from

getGateway

public any getGateway([string table=''], [string orderby=''], [string columns='*'], [string className='gateway'])

Parameters:
table
orderby
columns
className

getImportedKeys

public query getImportedKeys(string table)
returns primary keys that have been imported into a specified table

Parameters:
table - the name of the table to return key data from

getInsert

public any getInsert(string table, [struct insertData='[runtime expression]'])

Parameters:
table
insertData

getLocalization

public any getLocalization()


getMissingMethodParser

private any getMissingMethodParser()


getNextFromSequence

public string getNextFromSequence(string sequence)

Parameters:
sequence

getParameters

public query getParameters(string procedure)
returns parameters for a specified stored procedure

Parameters:
procedure - the name of the procedure to return parameter data from

getPrimaryKeyColumn

private any getPrimaryKeyColumn(string table)

Parameters:
table

getPrimaryKeys

public query getPrimaryKeys(string table)
gets primary key constraints for a specified table

Parameters:
table - the name of the table to return key data from

getProcedure

public any getProcedure()
returns an instantiated sql.procedure object


getReferenceColumns

public struct getReferenceColumns(string targetTable, string sourceTable, [string column=''], [string references=''])
returns default column names for a join clause based on foreign key constraints or conventions if no constraints are available

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

getReferenceKeys

private struct getReferenceKeys(string targetTable, string sourceTable, [string column=''], [string references=''])
returns default column names for a join clause based on foreign key constraints or conventions if no constraints are available

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

getSQLAgent

public any getSQLAgent()
returns an instantiated SQL Agent CFC which can execute statements associated with this datasource


getSchemaExport

public any getSchemaExport([string exportclass='schemaexport'])

Parameters:
exportclass

getSchemas

public query getSchemas()


getSelect

public any getSelect([string columns='*'], string table, [string orderby=''], [string groupby=''], [string having=''], [numeric maxrows='-1'])

Parameters:
columns
table
orderby
groupby
having
maxrows

getSources

private any getSources()


getStatement

public any getStatement(string type='select')
returns an instantiated sql.statement object of a specified type (select|insert|update|delete)

Parameters:
type

getStoredProcedures

public query getStoredProcedures([string procNames='%'])
lists all stored procedures in the catalog

Parameters:
procNames - a pattern to match for returned procedure names

getTables

public query getTables([string tableNames='%'], [string types='table,view'])
gets a list of views and/or tables in the catalog

Parameters:
tableNames - a pattern to match for returned table names
types - a comma delimited list of the table types to return

getTransaction

public any getTransaction([string className='transaction'])

Overrides:
getTransaction in class kernel
Parameters:
className

getUpdate

public any getUpdate(string table, [struct insertData='[runtime expression]'], [any column=''])

Parameters:
table
insertData
column - string or struct

getValidator

public any getValidator()


hasColumn

public boolean hasColumn(string entity, string column)

Parameters:
entity
column

hasConstraint

public boolean hasConstraint(string entity, string constraint)

Parameters:
entity
constraint

hasProcedure

public boolean hasProcedure(string entity)

Parameters:
entity

hasSequence

public boolean hasSequence(string entity)

Parameters:
entity

hasTable

public boolean hasTable(string entity)

Parameters:
entity

hasTableOrView

public boolean hasTableOrView(string entity)

Parameters:
entity

hasTrigger

public boolean hasTrigger(string entity, string trigger)

Parameters:
entity
trigger

hasView

public boolean hasView(string entity)

Parameters:
entity

isLoaded

public any isLoaded()


jdbcType

public string jdbcType(string type)

Parameters:
type

metadata

public any metadata()
executes the JDBC metadata object for this datasource


newID

public string newID([any ActiveRecord=''])

Parameters:
ActiveRecord

onMissingMethod

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

Overrides:
onMissingMethod in class duck
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.

parseDynamicSelect

private any parseDynamicSelect(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.

purge

public any purge()
purges cached queries for this database - does not affect cached metadata


raiseSloppyException

private any raiseSloppyException(string type, string table)

Parameters:
type
table

reset

public any reset()
purges cached metadata and queries for this database

Overrides:
reset in class duck

select

public query select([string columns='*'], string table, [struct filters='[runtime expression]'], [string orderby=''], [numeric maxrows='-1'], [boolean distinct='false'])

Parameters:
columns
table
filters
orderby
maxrows
distinct

setCacheManager

public any setCacheManager(any CacheManager)

Parameters:
CacheManager

setLocalization

public any setLocalization(any localization)

Parameters:
localization

setSources

public any setSources(any sources)

Parameters:
sources

sqlInsert

private any sqlInsert(string table, struct insertData)

Parameters:
table
insertData

update

public struct update(string table, struct insertData, [any column=''])

Parameters:
table
insertData
column - string or struct

DataFaucet 1.0 Beta