|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DaoWorker
Defines an interface for developing a Data Access Object worker.
Implementations of this interface will provide functionality to populate and retrieve data from a defined data dictionary.
Method Summary | |
---|---|
void |
destroy()
Destroy this worker. |
java.util.List |
executeCallForList(java.lang.String call,
java.lang.Object[] params)
Execute a stored procedure that will return a list of results. |
java.lang.Object[] |
executeCallForOutput(java.lang.String call,
java.lang.Object[] params,
java.lang.Object[] outParams,
int paramOffSet)
Execute a stored procedure that will return an array of registered output parameters. |
java.lang.Object |
executeCallForStatus(java.lang.String call,
java.lang.Object[] params)
Execute a stored procedure that will return the exit status of the procedure. |
java.util.List |
getAllEntries(java.lang.String tableName)
Returns all entries from the named table. |
java.util.List |
getAllEntries(java.lang.String tableName,
java.lang.Class returnType)
Returns all entries from the named table. |
java.util.List |
getCustomEntries(java.lang.String query,
java.lang.Object[] params)
Executes a custom select statement. |
java.util.List |
getCustomEntries(java.lang.String query,
java.lang.Object[] params,
java.lang.Class returnType)
Executes a custom select statement. |
java.util.List |
getCustomEntries(java.lang.String query,
java.lang.Object[] params,
java.lang.Class returnType,
int max)
Executes a custom select statement with a result size limit. |
java.util.List |
getCustomEntries(java.lang.String query,
java.lang.Object[] params,
int max)
Executes a custom select statement with a result size limit. |
java.util.Map |
getEntryByPrimaryKey(java.lang.String tableName,
java.util.Map pkValue)
Returns an entry from the named table by its primary key. |
java.lang.Object |
getEntryByPrimaryKey(java.lang.String tableName,
java.util.Map pkValue,
java.lang.Class returnType)
Returns an entry from the named table by its primary key. |
java.util.Map |
getEntryByPrimaryKey(java.lang.String tableName,
java.lang.Object pkValue)
Returns an entry from the named table by its primary key. |
java.lang.Object |
getEntryByPrimaryKey(java.lang.String tableName,
java.lang.Object pkValue,
java.lang.Class returnType)
Return an entry from the named table by it's primary key. |
void |
init(java.util.Map stmnts,
java.util.Map tableDefs,
DaoManager manager)
Initialise the worker with required data dictionary information. |
int |
insert(java.lang.String tableName,
java.util.Map values)
Inserts the given map of values into the named table. |
int |
insert(java.lang.String tableName,
java.util.Map values,
TransactionContext tc)
Inserts the given map of values into the named table within the given transaction context. |
java.lang.Object |
insertAndReturnKey(java.lang.String tableName,
java.util.Map values)
Inserts the given map of values into the named table and returns auto-generated key. |
java.lang.Object |
insertAndReturnKey(java.lang.String tableName,
java.util.Map values,
TransactionContext tc)
Inserts the given map of values into the named table and returns auto-generated key within the given transaction context. |
int |
removeCustomEntries(java.lang.String delete,
java.lang.Object[] params)
Executes a custom delete statement. |
int |
removeCustomEntries(java.lang.String delete,
java.lang.Object[] params,
TransactionContext tc)
Executes a custom delete statement within the given transaction context. |
int |
removeEntryByPrimaryKey(java.lang.String tableName,
java.util.Map pkValue)
Removes an entry from the named table using the given primary key value. |
int |
removeEntryByPrimaryKey(java.lang.String tableName,
java.util.Map pkValue,
TransactionContext tc)
Removes an entry from the named table using the given primary key value within the given transaction context. |
int |
removeEntryByPrimaryKey(java.lang.String tableName,
java.lang.Object pkValue)
Removes an entry from the named table using the given primary key value. |
int |
removeEntryByPrimaryKey(java.lang.String tableName,
java.lang.Object pkValue,
TransactionContext tc)
Removes an entry from the named table using the given primary key value within the given transaction context. |
int |
update(java.lang.String tableName,
java.util.Map values)
Update the named table with the given map of values. |
int |
update(java.lang.String tableName,
java.util.Map values,
TransactionContext tc)
Update the named table with the given map of values within the given transaction context. |
int |
updateCustomEntries(java.lang.String update,
java.lang.Object[] params)
Executes a custom update statement. |
int |
updateCustomEntries(java.lang.String update,
java.lang.Object[] params,
TransactionContext tc)
Executes a custom update statement within the given transaction context. |
Method Detail |
---|
void init(java.util.Map stmnts, java.util.Map tableDefs, DaoManager manager)
stmnts
- Map containing generated statements.tableDefs
- Map containing TableDefinitions.manager
- DaoManager that created this worker.int insert(java.lang.String tableName, java.util.Map values) throws DaoException
tableName
- Name of table to insert values into.values
- Map containig values to insert into the named table.
DaoException
- if a database access exception occurs.int insert(java.lang.String tableName, java.util.Map values, TransactionContext tc) throws DaoException
tableName
- Name of table to insert values into.values
- Map containig values to insert into the named table.tc
- Current transaction context.
DaoException
- if a database access exception occurs.java.lang.Object insertAndReturnKey(java.lang.String tableName, java.util.Map values) throws DaoException
tableName
- Name of table to insert values into.values
- Map containig values to insert into the named table.
DaoException
- if a database access exception occurs.java.lang.Object insertAndReturnKey(java.lang.String tableName, java.util.Map values, TransactionContext tc) throws DaoException
tableName
- Name of table to insert values into.values
- Map containig values to insert into the named table.tc
- Current transaction context.
DaoException
- if a database access exception occurs.int update(java.lang.String tableName, java.util.Map values) throws DaoException
tableName
- Name of table to insert values into.values
- Map containing update values.
DaoException
- if a database access exception occurs.int update(java.lang.String tableName, java.util.Map values, TransactionContext tc) throws DaoException
tableName
- Name of table to insert values into.values
- Map containing update values.tc
- Current transaction context.
DaoException
- if a database access exception occurs.java.util.Map getEntryByPrimaryKey(java.lang.String tableName, java.lang.Object pkValue) throws DaoException
tableName
- Name of table that contains target entrypkValue
- Object containing primary key value.
DaoException
- if an exception occurs while accessing the databasejava.lang.Object getEntryByPrimaryKey(java.lang.String tableName, java.lang.Object pkValue, java.lang.Class returnType) throws DaoException
The returned entry will be wrapped in the specified return type.
tableName
- Name of table that contains target entry.pkValue
- Object containing primary key value.returnType
- Class denoting the return type.
DaoException
- if an exception occurs while accessing the databasejava.util.Map getEntryByPrimaryKey(java.lang.String tableName, java.util.Map pkValue) throws DaoException
tableName
- Name of table that contains target entrypkValue
- Map containing primary key value.
DaoException
- if an exception occurs while accessing the databasejava.lang.Object getEntryByPrimaryKey(java.lang.String tableName, java.util.Map pkValue, java.lang.Class returnType) throws DaoException
The returned entry will be wrapped in the specified return type.
tableName
- Name of table that contains target entrypkValue
- Map containing primary key value.returnType
- Class denoting the return type.
DaoException
- if an exception occurs while accessing the databaseint removeEntryByPrimaryKey(java.lang.String tableName, java.lang.Object pkValue) throws DaoException
tableName
- Name of table that contains target entry.pkValue
- Object containing primary key value.
DaoException
- if an exception occurs while accessing the databaseint removeEntryByPrimaryKey(java.lang.String tableName, java.lang.Object pkValue, TransactionContext tc) throws DaoException
tableName
- Name of table that contains target entry.pkValue
- Object containing primary key value.tc
- Current transaction context.
DaoException
- if an exception occurs while accessing the databaseint removeEntryByPrimaryKey(java.lang.String tableName, java.util.Map pkValue) throws DaoException
tableName
- Name of table that contains target entry.pkValue
- Map containing primary key value.
DaoException
- if an exception occurs while accessing the databaseint removeEntryByPrimaryKey(java.lang.String tableName, java.util.Map pkValue, TransactionContext tc) throws DaoException
tableName
- Name of table that contains target entry.pkValue
- Map containing primary key value.tc
- Current transaction context.
DaoException
- if an exception occurs while accessing the databasejava.util.List getAllEntries(java.lang.String tableName) throws DaoException
tableName
- Name of table.
DaoException
- if an exception occurs while accessing the databasejava.util.List getAllEntries(java.lang.String tableName, java.lang.Class returnType) throws DaoException
The returned entries will be wrapped in the specified return type.
tableName
- Name of table.returnType
- Class denoting the specified return type.
DaoException
- if an exception occurs while accessing the databasejava.lang.Object executeCallForStatus(java.lang.String call, java.lang.Object[] params) throws DaoException
call
- String containing procedure call.params
- Object array containing procedure parameters.
DaoException
- if an exception occurs while executing the procedure.java.lang.Object[] executeCallForOutput(java.lang.String call, java.lang.Object[] params, java.lang.Object[] outParams, int paramOffSet) throws DaoException
call
- String containing procedure call.params
- Object array containing procedure parameters.outParams
- Object array containing output parameters.paramOffSet
- Offset where output parameters start.
DaoException
- if an exception occurs while executing the procedure.java.util.List executeCallForList(java.lang.String call, java.lang.Object[] params) throws DaoException
call
- String containing procedure call.params
- Object array containing procedure parameters.
DaoException
- if an exception occurs while executing the procedure.java.util.List getCustomEntries(java.lang.String query, java.lang.Object[] params) throws DaoException
query
- Custom query to execute.params
- Parameters for query.
DaoException
- if the custom query cannot be executed.java.util.List getCustomEntries(java.lang.String query, java.lang.Object[] params, java.lang.Class returnType) throws DaoException
The returned entries will be wrapped in the specified return type.
query
- Custom query to execute.params
- Parameters for query.returnType
- Class denoting the return type.
DaoException
- if the custom query cannot be executed.java.util.List getCustomEntries(java.lang.String query, java.lang.Object[] params, int max) throws DaoException
query
- Custom query to execute.params
- Parameters for query.max
- Maximum number entries that may be returned.
DaoException
- if the custom query cannot be executed.java.util.List getCustomEntries(java.lang.String query, java.lang.Object[] params, java.lang.Class returnType, int max) throws DaoException
The returned entries will be wrapped in the specified return type.
query
- Custom query to execute.params
- Parameters for query.returnType
- Class denoting the return type.max
- Maximum number entries that may be returned.
DaoException
- if the custom query cannot be executed.int updateCustomEntries(java.lang.String update, java.lang.Object[] params) throws DaoException
update
- Custom update statement.params
- Parameters for update.
DaoException
- if update cannot be executed.int updateCustomEntries(java.lang.String update, java.lang.Object[] params, TransactionContext tc) throws DaoException
update
- Custom update statement.params
- Parameters for update.tc
- Current transaction context.
DaoException
- if update cannot be executed.int removeCustomEntries(java.lang.String delete, java.lang.Object[] params) throws DaoException
delete
- Custom delete statement.params
- Parameters for delete statement.
DaoException
- if delete cannot be executed.int removeCustomEntries(java.lang.String delete, java.lang.Object[] params, TransactionContext tc) throws DaoException
delete
- Custom delete statement.params
- Parameters for delete statement.tc
- Current transaction context.
DaoException
- if delete cannot be executed.void destroy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |