| java.lang.Object com.mckoi.database.interpret.ColumnChecker
ColumnChecker | abstract class ColumnChecker (Code) | | A class that abstracts the checking of information in a table. This is
abstracted because the behaviour is shared between ALTER and CREATE
statement.
author: Tobias Downer |
Method Summary | |
void | checkColumnList(ArrayList list) Checks all the columns in the list and throws an exception if any
column names are not found in the columns in this create. | void | checkExpression(Expression expression) Resolves all the variables in the expression throwing a DatabaseException
if any errors found. | abstract String | resolveColumnName(String col_name) Returns the resolved column name if the column exists within the table
being checked under, or null if it doesn't. | static ColumnChecker | standardColumnChecker(DatabaseConnection database, TableName tname) Given a DatabaseConnection and a TableName object, this returns an
implementation of ColumnChecker that is able to check that the column
name exists in the table, and that the reference is not ambigious. | static ArrayList | stripColumnList(String table_domain, ArrayList column_list) Calls the 'stripTableName' method on all elements in the given list. | static String | stripTableName(String table_domain, String column) Given a column name string, this will strip off the preceeding table
name if there is one specified. |
checkColumnList | void checkColumnList(ArrayList list) throws DatabaseException(Code) | | Checks all the columns in the list and throws an exception if any
column names are not found in the columns in this create. Additionally
sets the entry with the correct column resolved to.
|
checkExpression | void checkExpression(Expression expression) throws DatabaseException(Code) | | Resolves all the variables in the expression throwing a DatabaseException
if any errors found. This checks that all variables point to a column
in the table being created.
|
resolveColumnName | abstract String resolveColumnName(String col_name) throws DatabaseException(Code) | | Returns the resolved column name if the column exists within the table
being checked under, or null if it doesn't. Throws an error if the
column name is abiguous.
|
standardColumnChecker | static ColumnChecker standardColumnChecker(DatabaseConnection database, TableName tname)(Code) | | Given a DatabaseConnection and a TableName object, this returns an
implementation of ColumnChecker that is able to check that the column
name exists in the table, and that the reference is not ambigious.
|
stripColumnList | static ArrayList stripColumnList(String table_domain, ArrayList column_list)(Code) | | Calls the 'stripTableName' method on all elements in the given list.
|
stripTableName | static String stripTableName(String table_domain, String column)(Code) | | Given a column name string, this will strip off the preceeding table
name if there is one specified. For example, 'Customer.id' would
become 'id'. This also checks that the table specification is in the
given table domain. For example,
stripTableName("Customer", "Customer.id") would not throw an error but
stripTableName("Order", "Customer.di") would.
|
|
|