|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object toolbox.services.BaseService toolbox.services.dao.DaoService
public class DaoService
Convenience service implementation that can be used to develop services
that require interaction with a RDBMS using the toolbox.dao
package.
Constructor Summary | |
---|---|
protected |
DaoService()
Default constructor. |
Method Summary | |
---|---|
protected boolean |
checkConstraint(java.lang.String query,
java.lang.Object[] params)
Convenience method to check a single foreign key constraint. |
void |
create(java.lang.String name,
java.lang.String confHome,
ServiceEnvironment env,
XMLProperties xmlProps)
Create the service by obtaining a refrence to the DaoManager in the provided environment. |
void |
destroy()
Destroy this service by destroying worker instance. |
protected java.util.List |
doCustomQuery(Query query)
Convenience method to execute the given query. |
protected java.util.List |
doCustomQuery(java.lang.String query)
Convenience method to execute a query without parameters. |
protected DaoManager |
getDaoManager()
Returns the DaoManager for this service. |
protected DaoWorker |
getDaoWorker()
Returns the DaoWorker for this service. |
protected java.lang.Integer |
getNextSequenceValue(java.lang.String seq)
Return the next value from the named oracle sequence. |
protected int |
insertDaoBean(java.lang.String table,
DaoBean bean)
Convenience method to insert the properties of the given DaoBean into the named table. |
protected int |
insertDaoBean(java.lang.String table,
DaoBean bean,
TransactionContext tc)
Convenience method to insert the properties of the given DaoBean into the named table within the given transaction context. |
protected int |
updateDaoBean(java.lang.String table,
DaoBean bean)
Convenience method to update the properties of the given DaoBean in the named table. |
protected int |
updateDaoBean(java.lang.String table,
DaoBean bean,
TransactionContext tc)
Convenience method to update the properties of the given DaoBean in the named table within the given TransactionContext. |
Methods inherited from class toolbox.services.BaseService |
---|
getConfigHome, getName, getProperties, getProperty, getXMLProperties, logConfig, logFine, logFiner, logFinest, logInfo, logSevere, logWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DaoService()
Method Detail |
---|
public void create(java.lang.String name, java.lang.String confHome, ServiceEnvironment env, XMLProperties xmlProps) throws ServiceException
create
in interface Service
create
in class BaseService
name
- The name of this service.confHome
- The path to the configuration home directory.env
- The service environment for this service.xmlProps
- XML configuration properties.
ServiceException
- if this service cannot be created.protected DaoWorker getDaoWorker()
protected DaoManager getDaoManager()
protected java.util.List doCustomQuery(java.lang.String query) throws ServiceException
query
- Query to execute.
ServiceException
protected java.util.List doCustomQuery(Query query) throws ServiceException
query
- Query to execute.
ServiceException
protected int insertDaoBean(java.lang.String table, DaoBean bean) throws ServiceException
table
- Name of table to insert bean properties.bean
- DaoBean instance.
ServiceException
- if the bean properties cannot be inserted.protected int insertDaoBean(java.lang.String table, DaoBean bean, TransactionContext tc) throws ServiceException
table
- Name of table to insert bean properties.bean
- DaoBean instance.tc
- Current TransactionContext.
ServiceException
- if the bean properties cannot be inserted.protected int updateDaoBean(java.lang.String table, DaoBean bean) throws ServiceException
table
- Name of table to update.bean
- DaoBean instance.
ServiceException
- if the bean properties cannot be updated.protected int updateDaoBean(java.lang.String table, DaoBean bean, TransactionContext tc) throws ServiceException
table
- Name of table to update.bean
- DaoBean instance.tc
- Current TransactionContext.
ServiceException
- if the bean properties cannot be updated.protected boolean checkConstraint(java.lang.String query, java.lang.Object[] params) throws ServiceException
The query must return a single column named "count". If the count is greater than 0 the constraint exists.
query
- Constraint query string.params
- Constraint parameters
ServiceException
- if an exception occurs while checking the
constraint.protected java.lang.Integer getNextSequenceValue(java.lang.String seq) throws ServiceException
seq
- String containing the name of the sequence.
ServiceException
- if the value cannot be returned.public void destroy()
destroy
in interface Service
destroy
in class BaseService
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |