|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object toolbox.dao.DaoWorkerImpl
public class DaoWorkerImpl
Default implementation of the DaoWorker interface. Provides implementation for all methods of the interface.
Constructor Summary | |
---|---|
DaoWorkerImpl()
Default constructor |
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 exit status of the procedure. |
java.util.List |
getAllEntries(java.lang.String tableName)
Return all entries from the named table. |
java.util.List |
getAllEntries(java.lang.String tableName,
java.lang.Class returnType)
Return 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. |
java.util.List |
getCustomEntries(java.lang.String query,
java.lang.Object[] params,
int max)
Executes a custom select statement. |
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)
Returns an entry from the named table by its 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 Object map of values into the named table and returns an auto-generated key. |
java.lang.Object |
insertAndReturnKey(java.lang.String tableName,
java.util.Map values,
TransactionContext tc)
Inserts the given Object map of values into the named table and returns an 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DaoWorkerImpl()
Method Detail |
---|
public void init(java.util.Map stmnts, java.util.Map tableDefs, DaoManager manager)
init
in interface DaoWorker
stmnts
- Map containing generated statements.tableDefs
- Map containing TableDefinitions.manager
- DaoManager that created this worker.public int insert(java.lang.String tableName, java.util.Map values) throws DaoException
insert
in interface DaoWorker
tableName
- Name of table to insert values into. Must be defined
in the XML configuration.values
- Map containig values to insert into the named
table.
DaoException
- if a database access exception occurs.public int insert(java.lang.String tableName, java.util.Map values, TransactionContext tc) throws DaoException
insert
in interface DaoWorker
tableName
- Name of table to insert values into. Must be defined
in the XML configuration.values
- Map containig values to insert into the named
table.tc
- Current transaction context.
DaoException
- if a database access exception occurs.public java.lang.Object insertAndReturnKey(java.lang.String tableName, java.util.Map values) throws DaoException
insertAndReturnKey
in interface DaoWorker
tableName
- Name of table to insert values into. Must be defined
in the XML configuration.values
- Map containig values to insert into the named
table.
DaoException
- if a database access exception occurs.public java.lang.Object insertAndReturnKey(java.lang.String tableName, java.util.Map values, TransactionContext tc) throws DaoException
insertAndReturnKey
in interface DaoWorker
tableName
- Name of table to insert values into. Must be defined
in the XML configuration.values
- Map containig values to insert into the named
table.tc
- Current transaction context.
DaoException
- if a database access exception occurs.public int update(java.lang.String tableName, java.util.Map values) throws DaoException
update
in interface DaoWorker
tableName
- Name of table to insert values into. Must be defined
in the XML configuration.values
- Map containing update values.
DaoException
- if a database access exception occurs.public int update(java.lang.String tableName, java.util.Map values, TransactionContext tc) throws DaoException
update
in interface DaoWorker
tableName
- Name of table to insert values into. Must be defined
in the XML configuration.values
- Map containing update values.tc
- Current transaction context.
DaoException
- if a database access exception occurs.public java.util.Map getEntryByPrimaryKey(java.lang.String tableName, java.util.Map pkValue) throws DaoException
getEntryByPrimaryKey
in interface DaoWorker
tableName
- Name of table that contains target entrypkValue
- Map containing primary key value.
DaoException
- if an exception occurs while accessing the databasepublic java.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.
getEntryByPrimaryKey
in interface DaoWorker
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 databasepublic java.util.Map getEntryByPrimaryKey(java.lang.String tableName, java.lang.Object pkValue) throws DaoException
getEntryByPrimaryKey
in interface DaoWorker
tableName
- Name of table that contains target entrypkValue
- Object containing primary key value.
DaoException
- if an exception occurs while accessing the databasepublic java.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.
getEntryByPrimaryKey
in interface DaoWorker
tableName
- Name of table that contains target entrypkValue
- Object containing primary key value.returnType
- Class denoting the return type.
DaoException
- if an exception occurs while accessing the databasepublic int removeEntryByPrimaryKey(java.lang.String tableName, java.lang.Object pkValue) throws DaoException
removeEntryByPrimaryKey
in interface DaoWorker
tableName
- Name of table that contains target entry.pkValue
- Object containing primary key value.
DaoException
- if an exception occurs while accessing the databasepublic int removeEntryByPrimaryKey(java.lang.String tableName, java.lang.Object pkValue, TransactionContext tc) throws DaoException
removeEntryByPrimaryKey
in interface DaoWorker
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 databasepublic int removeEntryByPrimaryKey(java.lang.String tableName, java.util.Map pkValue) throws DaoException
removeEntryByPrimaryKey
in interface DaoWorker
tableName
- Name of table that contains target entry.pkValue
- Map containing primary key value.
DaoException
- if an exception occurs while accessing the databasepublic int removeEntryByPrimaryKey(java.lang.String tableName, java.util.Map pkValue, TransactionContext tc) throws DaoException
removeEntryByPrimaryKey
in interface DaoWorker
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 databasepublic java.util.List getAllEntries(java.lang.String tableName) throws DaoException
getAllEntries
in interface DaoWorker
tableName
- Name of table.
DaoException
- if an exception occurs while accessing the databasepublic java.util.List getAllEntries(java.lang.String tableName, java.lang.Class returnType) throws DaoException
The returned entry will be wrapped in the specified return type.
getAllEntries
in interface DaoWorker
tableName
- Name of table.returnType
- Class denoting the return type.
DaoException
- if an exception occurs while accessing the databasepublic java.lang.Object executeCallForStatus(java.lang.String call, java.lang.Object[] params) throws DaoException
executeCallForStatus
in interface DaoWorker
call
- String containing procedure call.params
- Object array containing procedure parameters
DaoException
- if an exception occurs while executing the procedure.public java.lang.Object[] executeCallForOutput(java.lang.String call, java.lang.Object[] params, java.lang.Object[] outParams, int paramOffSet) throws DaoException
executeCallForOutput
in interface DaoWorker
call
- String containing procedure call.params
- Object array containing procedure parameters.outParams
- Object array containing output parameters.paramOffSet
- The offset where the output parameters start.
DaoException
- if an exception occurs while executing the procedure.public java.util.List executeCallForList(java.lang.String call, java.lang.Object[] params) throws DaoException
executeCallForList
in interface DaoWorker
call
- String containing procedure call.params
- Object array containing procedure parameters
DaoException
- if an exception occurs while executing the procedure.public java.util.List getCustomEntries(java.lang.String query, java.lang.Object[] params, int max) throws DaoException
getCustomEntries
in interface DaoWorker
query
- Custom query to execute.params
- Parameters for query.max
- Maximum number of entries that may be returned. The value
0 indicates no limit.
DaoException
- if the custom query cannot be executed.public 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.
getCustomEntries
in interface DaoWorker
query
- Custom query to execute.params
- Parameters for query.returnType
- Class denoting the return type.max
- Maximum number of entries that may be returned.
The value 0 indicates no limit.
DaoException
- if the custom query cannot be executed.public java.util.List getCustomEntries(java.lang.String query, java.lang.Object[] params) throws DaoException
getCustomEntries
in interface DaoWorker
query
- Custom query to execute.params
- Parameters for query.
DaoException
- if the custom query cannot be executed.public 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.
getCustomEntries
in interface DaoWorker
query
- Custom query to execute.params
- Parameters for query.returnType
- Class denoting the return type.
DaoException
- if the custom query cannot be executed.public int updateCustomEntries(java.lang.String update, java.lang.Object[] params) throws DaoException
updateCustomEntries
in interface DaoWorker
update
- Custom update statement.params
- Parameters for update.
DaoException
- if update cannot be executed.public int updateCustomEntries(java.lang.String update, java.lang.Object[] params, TransactionContext tc) throws DaoException
updateCustomEntries
in interface DaoWorker
update
- Custom update statement.params
- Parameters for update.tc
- Current transaction context.
DaoException
- if update cannot be executed.public int removeCustomEntries(java.lang.String delete, java.lang.Object[] params) throws DaoException
removeCustomEntries
in interface DaoWorker
delete
- Custom delete statement.params
- Parameters for delete statement.
DaoException
- if delete cannot be executed.public int removeCustomEntries(java.lang.String delete, java.lang.Object[] params, TransactionContext tc) throws DaoException
removeCustomEntries
in interface DaoWorker
delete
- Custom delete statement.params
- Parameters for delete statement.tc
- Current transaction context.
DaoException
- if delete cannot be executed.public void destroy()
destroy
in interface DaoWorker
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |