|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dbforms.event.datalist.dao.AbstractDataSource
public abstract class AbstractDataSource
Abstract base class for DataSource.
| Constructor Summary | |
|---|---|
AbstractDataSource()
Creates a new DataSource object. |
|
| Method Summary | |
|---|---|
protected abstract void |
close()
should close all open datasets |
protected void |
deleteBlobFilesFromDisk(FieldValues fieldValues)
deletes the blob files on disk |
int |
doDelete(DbEventInterceptorData interceptorData,
String keyValuesStr)
performs an delete in the DataSource |
int |
doInsert(DbEventInterceptorData interceptorData,
FieldValues fieldValues)
performs an insert into the DataSource |
int |
doUpdate(DbEventInterceptorData interceptorData,
FieldValues fieldValues,
String keyValuesStr)
performs an update into the DataSource |
protected abstract int |
findStartRow(String startRow)
maps the startRow to the internal index |
ResultSetVector |
getCurrent(DbEventInterceptorData interceptorData,
String position,
int count)
get count rows from position |
ResultSetVector |
getFirst(DbEventInterceptorData interceptorData,
int count)
get count rows from first row |
ResultSetVector |
getLast(DbEventInterceptorData interceptorData,
int count)
get count rows from last row |
ResultSetVector |
getNext(DbEventInterceptorData interceptorData,
String position,
int count)
get count next rows from position |
ResultSetVector |
getPrev(DbEventInterceptorData interceptorData,
String position,
int count)
get count rows backwards from position |
protected ResultSetVector |
getResultSetVector(DbEventInterceptorData interceptorData,
int startRow,
int count)
DOCUMENT ME! |
protected abstract Object[] |
getRow(int i)
should retrieve the row at an special index as an Object[] |
Table |
getTable()
gets the Table for the DataSource |
protected abstract boolean |
hasMore(int i)
return true if there are more records to fetch then the given record number |
protected abstract void |
open()
Will be called to open all datasets |
protected void |
saveBlobFilesToDisk(FieldValues fieldValues)
save the blob files to disk |
protected void |
setConnection(Connection con,
String dbConnectionName)
set the connection parameter for the DataSouce. virtual method, if you need the connection data you must override this method |
abstract void |
setSelect(FieldValue[] filterConstraint,
FieldValue[] orderConstraint,
String sqlFilter,
FieldValue[] sqlFilterParams)
Sets the select data for this dataSource |
void |
setSelect(String tableList,
String whereClause)
Sets the select data for this dataSource for free form selects. default methods just raises an exception |
protected void |
setTable(Table table)
|
protected abstract int |
size()
Must return the size of the whole resultset with all data fetch |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractDataSource()
| Method Detail |
|---|
public abstract void setSelect(FieldValue[] filterConstraint,
FieldValue[] orderConstraint,
String sqlFilter,
FieldValue[] sqlFilterParams)
filterConstraint - FieldValue array used to restrict a set in a resultsetorderConstraint - FieldValue array used to build a cumulation of rules for
ordering (sorting)sqlFilter - sql condition to add to where clausesqlFilterParams - list of FieldValues to fill the sqlFilter with
public ResultSetVector getCurrent(DbEventInterceptorData interceptorData,
String position,
int count)
throws SQLException
position - keyValueStr to the rowcount - count of rows to fetch
SQLException
public ResultSetVector getFirst(DbEventInterceptorData interceptorData,
int count)
throws SQLException
count - count of rows to fetch
SQLException
public ResultSetVector getLast(DbEventInterceptorData interceptorData,
int count)
throws SQLException
count - count of rows to fetch
SQLException
public ResultSetVector getNext(DbEventInterceptorData interceptorData,
String position,
int count)
throws SQLException
position - keyValueStr to the rowcount - count of rows to fetch
SQLException
public ResultSetVector getPrev(DbEventInterceptorData interceptorData,
String position,
int count)
throws SQLException
position - keyValueStr to the rowcount - count of rows to fetch
SQLException
public void setSelect(String tableList,
String whereClause)
throws SQLException
tableList - the list of tables involved into the querywhereClause - free-form whereClause to be appended to query
SQLExceptionpublic Table getTable()
public int doDelete(DbEventInterceptorData interceptorData,
String keyValuesStr)
throws SQLException
con - DOCUMENT ME!keyValuesStr - keyValueStr to the row to updateSQLException - if any error occurs
public int doInsert(DbEventInterceptorData interceptorData,
FieldValues fieldValues)
throws SQLException
con - DOCUMENT ME!fieldValues - FieldValues to insert
SQLException
public int doUpdate(DbEventInterceptorData interceptorData,
FieldValues fieldValues,
String keyValuesStr)
throws SQLException
con - DOCUMENT ME!fieldValues - FieldValues to updatekeyValuesStr - keyValueStr to the row to updateSQLException - if any error occurs
protected void setConnection(Connection con,
String dbConnectionName)
con - the JDBC Connection objectdbConnectionName - name of the used db connection. Can be used to get an own db
connection, e.g. to hold it during the session (see
DataSourceJDBC for example!)
protected abstract Object[] getRow(int i)
throws SQLException
i - index of row to fetch
SQLExceptionprotected abstract void close()
protected abstract int findStartRow(String startRow)
throws SQLException
startRow - keyValueStr to the rowSQLException
protected abstract boolean hasMore(int i)
throws SQLException
i - index of last fetched row.
SQLException
protected abstract void open()
throws SQLException
SQLException
protected abstract int size()
throws SQLException
SQLExceptionprotected void setTable(Table table)
table - The table to set.
protected void deleteBlobFilesFromDisk(FieldValues fieldValues)
throws SQLException
fieldValues - FieldValues to delete, called by
SQLException
protected void saveBlobFilesToDisk(FieldValues fieldValues)
throws SQLException
fieldValues - FieldValues to update
SQLException
IllegalArgumentException
protected ResultSetVector getResultSetVector(DbEventInterceptorData interceptorData,
int startRow,
int count)
throws SQLException
startRow - count -
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||