All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----tc.database.DatabaseQuery
DatabaseQuery
is a common interface for all database queries. It
defines the methods which a database query must implement so that
DatabaseManager
can execute it.
getSQLClause
returned) or modifying the dataset.
DatabaseManager
always calls this method before the actual
calculation.
DatabaseManager
of this query.
QueryDataSet
for this query.
DatabaseManager
for this query.
private DatabaseManager databaseManager
private Object parameters
private Object result
public DatabaseQuery()
public abstract void calculate(QueryDataSet dataset) throws DataSetException, ValidationException
getSQLClause
returned) or modifying the dataset.
If this query is a read query this method should create the result object
that is retuned in getResult
. Otherwise, if this query is a
write query this method should modify or remove the wanted rows in the
dataset. The dataset includes proper methods for iterating and examining
it.
public DatabaseManager getDatabaseManager()
DatabaseManager
of this query.
public void doValidationCheck() throws ValidationException
DatabaseManager
always calls this method before the actual
calculation. In this method a database query can perform an additional
check which ensures that the query can be performed. If the check fails,
the method must throw a subclass of ValidationException.
public Object getResult()
public abstract String getSQLClause()
QueryDataSet
for this query. The create dataset is fetched as
a parameter for the calculate
method.
public abstract boolean isWriteQuery()
public void setDatabaseManager(DatabaseManager dbm)
DatabaseManager
for this query.
public void setResult(Object res)
protected Object getParameters()
protected void setParameters(Object p)
All Packages Class Hierarchy This Package Previous Next Index