|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--org.j2ee.dao.AbstractHibernateDAOAction
Based on an example of book Code Notes for J2EE, Edited by GREGORY BRILL,
e-ISBN 0-679-64727-9
Last modified $Date: 2004/05/18 10:50:12 $
| Field Summary |
|---|
| Fields inherited from interface org.j2ee.dao.HibernateDAOAction |
|---|
DELETE, HQL_QUERY, LOAD, SAVE, SQL_QUERY, UPDATE |
| Constructor Summary | |
|---|---|
AbstractHibernateDAOAction()
Default constructor, set HQL operation as default |
|
AbstractHibernateDAOAction(int stmtTypeValue)
Specialized constructor |
|
| Method Summary | |
|---|---|
void |
execute(org.j2ee.dao.DAOActionProcessor processor)
Execute this action using the given processor If there are exception, try to conver it with the Error Mapper and then call to Error Handler of this aciont |
java.lang.String |
getHQL()
Implement this method if you are writting a HQL based Action |
java.lang.String[] |
getNamesForParams()
This method retuns the names for parameters to be setted to sql/hql statement. |
java.lang.Object[] |
getParameters()
This method retuns the parameters to be setted to SQL/HQL statement. |
java.lang.String[] |
getReturnAliasForSqlQuery()
Alias used into the SQL query with the sintax {alias} |
java.lang.Class[] |
getReturnClassForSqlQuery()
Hibernate requieres a class for every object returned by an SQL query |
java.lang.String |
getSQL()
Implement this method if you are writting a SQL based Action |
int |
getStmtType()
getter for private attribute |
java.lang.Object |
getTO()
REDEFINE THIS METHOD ON EVERY SUBCLASS The transfer object used or setted by the action. |
void |
handleResult()
Called by the Processor after an Hibernate succefull save,update,delete operation |
void |
handleResult(java.lang.Object to)
Called by the Processor after an Hibernate succefull load operation |
void |
handleResults(java.util.List rs)
Called by the Processor after an SQL or HQL succefull operation |
boolean |
isCaching()
|
boolean |
isDelete()
Returs true if this action is an DELETE statement |
boolean |
isHqlQuery()
Returs true if this action is a HQL_QUERY statement |
boolean |
isLoad()
Returs true if this action is an LOAD statement |
boolean |
isSave()
Returs true if this action is an SAVE statement |
boolean |
isSqlQuery()
Returs true if this action is a SQL_QUERY statement |
boolean |
isUpdate()
Returs true if this action is an UPDATE statement |
void |
setCaching(boolean caching)
Defines if the HQL or SQL query should be cached by the processor |
void |
setErrorHandler(org.j2ee.dao.DAOErrorHandler handler)
This method allows to the action to set a class which manage application errors such as integrity constraint violated. |
void |
setStmtType(int stmtType)
setter method for private attribute |
void |
setTO(java.lang.Object to)
REDEFINE THIS METHOD ON EVERY SUBCLASS Set the private attribute, the transfer object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractHibernateDAOAction()
public AbstractHibernateDAOAction(int stmtTypeValue)
stmtTypeValue - type of operation of this action| Method Detail |
public void setTO(java.lang.Object to)
setTO in interface DAOActionto - (The Transfer Object used by the action)public java.lang.Object getTO()
getTO in interface DAOActionpublic void setErrorHandler(org.j2ee.dao.DAOErrorHandler handler)
setErrorHandler in interface DAOActionhandler - a instance with the application code to manage the exceptioninterface for a list of the code passed to methodpublic java.lang.String getSQL()
getSQL in interface HibernateDAOActionpublic java.lang.String getHQL()
getHQL in interface HibernateDAOActionpublic java.lang.Object[] getParameters()
HibernateDAOAction
getParameters in interface HibernateDAOActionpublic java.lang.String[] getNamesForParams()
HibernateDAOAction
getNamesForParams in interface HibernateDAOActionpublic java.lang.Class[] getReturnClassForSqlQuery()
getReturnClassForSqlQuery in interface HibernateDAOActionpublic java.lang.String[] getReturnAliasForSqlQuery()
getReturnAliasForSqlQuery in interface HibernateDAOActionpublic int getStmtType()
getStmtType in interface HibernateDAOActionpublic void setStmtType(int stmtType)
setStmtType in interface HibernateDAOActionstmtType - valuepublic boolean isSqlQuery()
HibernateDAOAction
isSqlQuery in interface HibernateDAOActionpublic boolean isHqlQuery()
HibernateDAOAction
isHqlQuery in interface HibernateDAOActionpublic boolean isSave()
HibernateDAOAction
isSave in interface HibernateDAOActionpublic boolean isUpdate()
HibernateDAOAction
isUpdate in interface HibernateDAOActionpublic boolean isDelete()
HibernateDAOAction
isDelete in interface HibernateDAOActionpublic boolean isLoad()
HibernateDAOAction
isLoad in interface HibernateDAOAction
public void handleResults(java.util.List rs)
throws java.lang.Exception
handleResults in interface HibernateDAOActionrs - List with the object results
java.lang.Exception - generated by this method
public void handleResult(java.lang.Object to)
throws java.lang.Exception
handleResult in interface HibernateDAOActionto - the object loaded
java.lang.Exception
public void handleResult()
throws java.lang.Exception
handleResult in interface HibernateDAOActionjava.lang.Exception - generated by this method
public void execute(org.j2ee.dao.DAOActionProcessor processor)
throws DAOException
execute in interface DAOActionprocessor - which will execute the action
DAOException - generated by this methodpublic boolean isCaching()
isCaching in interface HibernateDAOActionpublic void setCaching(boolean caching)
setCaching in interface HibernateDAOActioncaching -
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||