|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.database.Database
class Database
Provides a database implementation which uses the Hypersonic SQL Database.
Field Summary |
---|
Fields inherited from interface org.vizzini.database.IDatabase |
---|
ID_FIELD_NAME |
Constructor Summary | |
---|---|
protected |
Database(DBDescriptor descriptor)
Construct this object from the given database descriptor. |
protected |
Database(DBDescriptor descriptor,
boolean isFileBased)
Construct this object from the given database descriptor. |
(package private) |
Database(Document document)
Construct this object from the given file. |
(package private) |
Database(File file)
Construct this object from the given file. |
(package private) |
Database(InputStream inputStream)
Construct this object from the given file. |
Method Summary | |
---|---|
protected void |
create(DBDescriptor descriptor)
Create the database tables using the given descriptor. |
protected List |
createRecordsFrom(ITableData tableData,
ResultSet rs)
Create IRecord objects from the given result set. |
protected void |
createTable(ITableData tableData)
Create a database table using the given table data. |
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. |
protected static void |
printList(String title,
List rows)
|
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. |
String |
toString()
Return a string representation of this object. |
void |
update(String expression)
Update the database by executing the given expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Database(DBDescriptor descriptor) throws ClassNotFoundException, SQLException
ClassNotFoundException
SQLException
protected Database(DBDescriptor descriptor, boolean isFileBased) throws ClassNotFoundException, SQLException
ClassNotFoundException
SQLException
Database(Document document) throws ClassNotFoundException, SQLException
document
- Document containing the database descriptor
information.
ClassNotFoundException
SQLException
Database(File file) throws ParserConfigurationException, SAXException, IOException, ClassNotFoundException, SQLException
file
- File containing the database descriptor information.
ParserConfigurationException
SAXException
IOException
ClassNotFoundException
SQLException
Database(InputStream inputStream) throws ParserConfigurationException, SAXException, IOException, ClassNotFoundException, SQLException
inputStream
- Input stream containing the database descriptor
information.
ParserConfigurationException
SAXException
IOException
ClassNotFoundException
SQLException
Method Detail |
---|
public List executeQuery(String expression) throws SQLException
GenericData
s which are derived from the
result of the given query.
executeQuery
in interface IDatabase
expression
- An SQL expression, typically a select.
SQLException
public Iterator getJoinData()
getJoinData
in interface IDatabase
public Iterator getJoinsFor(ITableData tableData)
getJoinsFor
in interface IDatabase
IAssociation
s.public Iterator getJoinsFor(ITableData tableData0, ITableData tableData1)
getJoinsFor
in interface IDatabase
IAssociation
s.public Iterator getJunctionsFor(ITableData tableData)
getJunctionsFor
in interface IDatabase
IAssociation
s.public Iterator getJunctionsFor(ITableData tableData0, ITableData tableData1)
getJunctionsFor
in interface IDatabase
IAssociation
s.public Iterator getTableData()
getTableData
in interface IDatabase
public ITableData getTableData(String tableName)
getTableData
in interface IDatabase
public boolean isStringType(String tableName, String columnName)
isStringType
in interface IDatabase
public boolean isStringType(ITableData tableData, String columnName)
isStringType
in interface IDatabase
public List select(String tableName) throws SQLException
IRecord
s which are derived from the
result of the given query.
select
in interface IDatabase
tableName
- The table name from which to select.
SQLException
public List select(ITableData tableData) throws SQLException
IRecord
s which are derived from the
result of the given query.
select
in interface IDatabase
tableData
- The table data from which to select.
SQLException
public List select(String tableName, String whereClause) throws SQLException
IRecord
s which are derived from the
result of the given query.
select
in interface IDatabase
tableName
- The table name from which to select.whereClause
- An optional where clause (without the where).
SQLException
public List select(ITableData tableData, String whereClause) throws SQLException
IRecord
s which are derived from the
result of the given query.
select
in interface IDatabase
tableData
- The table data from which to select.whereClause
- An optional where clause (without the where).
SQLException
public List select(ITableData tableData, IRecord record) throws SQLException
IRecord
objects which belong to the named
table and are joined to the given record.
select
in interface IDatabase
tableData
- The table data from which to select.record
- The object to which the answers are related.
SQLException
public void shutdown() throws SQLException
shutdown
in interface IDatabase
SQLException
public String toString()
toString
in class Object
public void update(String expression) throws SQLException
update
in interface IDatabase
expression
- The expression to execute.
SQLException
protected static void printList(String title, List rows)
protected void create(DBDescriptor descriptor)
protected List createRecordsFrom(ITableData tableData, ResultSet rs) throws SQLException
IRecord
objects from the given result set.
SQLException
protected void createTable(ITableData tableData)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |