org.vizzini.database
Interface IDatabase

All Known Implementing Classes:
Database

public interface IDatabase

Provides an interface which defines methods required by database objects.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Field Summary
static String ID_FIELD_NAME
          The name of the special identity field.
 
Method Summary
 List executeQuery(String expression)
          Returns a list of GenericData s which are derived from the result of the given query.
 Iterator getJoinData()
          Return an iterator over the join data.
 Iterator getJoinsFor(ITableData tableData)
          Return all joins which involve the given table.
 Iterator getJoinsFor(ITableData tableData0, ITableData tableData1)
          Return all joins which involve the given tables.
 Iterator getJunctionsFor(ITableData tableData)
          Return all junctions which involve the given table.
 Iterator getJunctionsFor(ITableData tableData0, ITableData tableData1)
          Return all junctions which involve the given tables.
 Iterator getTableData()
          Return an iterator over the table data.
 ITableData getTableData(String tableName)
          Return the table data with the given name.
 boolean isStringType(ITableData tableData, String columnName)
          Return true if the given column has string type.
 boolean isStringType(String tableName, String columnName)
          Return true if the given column has string type.
 List select(ITableData tableData)
          Returns a list of IRecord s which are derived from the result of the given query.
 List select(ITableData tableData, IRecord record)
          Return a list of IRecord objects which belong to the named table and are joined to the given record.
 List select(ITableData tableData, String whereClause)
          Returns a list of IRecord s which are derived from the result of the given query.
 List select(String tableName)
          Returns a list of IRecord s which are derived from the result of the given query.
 List select(String tableName, String whereClause)
          Returns a list of IRecord s which are derived from the result of the given query.
 void shutdown()
          Shutdown the database connection.
 void update(String expression)
          Update the database by executing the given expression.
 

Field Detail

ID_FIELD_NAME

static final String ID_FIELD_NAME
The name of the special identity field. Every table contains this field.

See Also:
Constant Field Values
Method Detail

isStringType

boolean isStringType(String tableName,
                     String columnName)
Return true if the given column has string type.

Since:
v0.3

isStringType

boolean isStringType(ITableData tableData,
                     String columnName)
Return true if the given column has string type.

Since:
v0.3

executeQuery

List executeQuery(String expression)
                  throws SQLException
Returns a list of GenericData s which are derived from the result of the given query.

Parameters:
expression - An SQL expression, typically a select.
Throws:
SQLException
Since:
v0.3

getJoinData

Iterator getJoinData()
Return an iterator over the join data.

Since:
v0.3

getJoinsFor

Iterator getJoinsFor(ITableData tableData)
Return all joins which involve the given table.

Returns:
A list containing IAssociation s.
Since:
v0.3

getJoinsFor

Iterator getJoinsFor(ITableData tableData0,
                     ITableData tableData1)
Return all joins which involve the given tables.

Returns:
A list containing IAssociation s.
Since:
v0.3

getJunctionsFor

Iterator getJunctionsFor(ITableData tableData)
Return all junctions which involve the given table.

Returns:
A list containing IAssociation s.
Since:
v0.3

getJunctionsFor

Iterator getJunctionsFor(ITableData tableData0,
                         ITableData tableData1)
Return all junctions which involve the given tables.

Returns:
A list containing IAssociation s.
Since:
v0.3

getTableData

Iterator getTableData()
Return an iterator over the table data.

Since:
v0.3

getTableData

ITableData getTableData(String tableName)
Return the table data with the given name.

Since:
v0.3

select

List select(String tableName)
            throws SQLException
Returns a list of IRecord s which are derived from the result of the given query.

Parameters:
tableName - The table name from which to select.
Throws:
SQLException
Since:
v0.3

select

List select(ITableData tableData)
            throws SQLException
Returns a list of IRecord s which are derived from the result of the given query.

Parameters:
tableData - The table data from which to select.
Throws:
SQLException
Since:
v0.3

select

List select(String tableName,
            String whereClause)
            throws SQLException
Returns a list of IRecord s which are derived from the result of the given query.

Parameters:
tableName - The table name from which to select.
whereClause - An optional where clause (without the where).
Throws:
SQLException
Since:
v0.3

select

List select(ITableData tableData,
            String whereClause)
            throws SQLException
Returns a list of IRecord s which are derived from the result of the given query.

Parameters:
tableData - The table data from which to select.
whereClause - An optional where clause (without the where).
Throws:
SQLException
Since:
v0.3

select

List select(ITableData tableData,
            IRecord record)
            throws SQLException
Return a list of IRecord objects which belong to the named table and are joined to the given record.

Parameters:
tableData - The table data from which to select.
record - The object to which the answers are related.
Throws:
SQLException
Since:
v0.3

shutdown

void shutdown()
              throws SQLException
Shutdown the database connection.

Throws:
SQLException
Since:
v0.3

update

void update(String expression)
            throws SQLException
Update the database by executing the given expression. Use for SQL commands DROP and INSERT and UPDATE

Parameters:
expression - The expression to execute.
Throws:
SQLException
Since:
v0.3


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02