|
||||||||||||
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 actionMethod Detail |
public void setTO(java.lang.Object to)
setTO
in interface DAOAction
to
- (The Transfer Object used by the action)public java.lang.Object getTO()
getTO
in interface DAOAction
public void setErrorHandler(org.j2ee.dao.DAOErrorHandler handler)
setErrorHandler
in interface DAOAction
handler
- a instance with the application code to manage the exceptioninterface for a list of the code passed to method
public java.lang.String getSQL()
getSQL
in interface HibernateDAOAction
public java.lang.String getHQL()
getHQL
in interface HibernateDAOAction
public java.lang.Object[] getParameters()
HibernateDAOAction
getParameters
in interface HibernateDAOAction
public java.lang.String[] getNamesForParams()
HibernateDAOAction
getNamesForParams
in interface HibernateDAOAction
public java.lang.Class[] getReturnClassForSqlQuery()
getReturnClassForSqlQuery
in interface HibernateDAOAction
public java.lang.String[] getReturnAliasForSqlQuery()
getReturnAliasForSqlQuery
in interface HibernateDAOAction
public int getStmtType()
getStmtType
in interface HibernateDAOAction
public void setStmtType(int stmtType)
setStmtType
in interface HibernateDAOAction
stmtType
- valuepublic boolean isSqlQuery()
HibernateDAOAction
isSqlQuery
in interface HibernateDAOAction
public boolean isHqlQuery()
HibernateDAOAction
isHqlQuery
in interface HibernateDAOAction
public boolean isSave()
HibernateDAOAction
isSave
in interface HibernateDAOAction
public boolean isUpdate()
HibernateDAOAction
isUpdate
in interface HibernateDAOAction
public boolean isDelete()
HibernateDAOAction
isDelete
in interface HibernateDAOAction
public boolean isLoad()
HibernateDAOAction
isLoad
in interface HibernateDAOAction
public void handleResults(java.util.List rs) throws java.lang.Exception
handleResults
in interface HibernateDAOAction
rs
- List with the object results
java.lang.Exception
- generated by this methodpublic void handleResult(java.lang.Object to) throws java.lang.Exception
handleResult
in interface HibernateDAOAction
to
- the object loaded
java.lang.Exception
public void handleResult() throws java.lang.Exception
handleResult
in interface HibernateDAOAction
java.lang.Exception
- generated by this methodpublic void execute(org.j2ee.dao.DAOActionProcessor processor) throws DAOException
execute
in interface DAOAction
processor
- which will execute the action
DAOException
- generated by this methodpublic boolean isCaching()
isCaching
in interface HibernateDAOAction
public void setCaching(boolean caching)
setCaching
in interface HibernateDAOAction
caching
-
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |