net.sf.basedb.core
Class AbstractSqlQuery.CountWork
java.lang.Object
net.sf.basedb.core.hibernate.ResultSetWork<Long>
net.sf.basedb.core.AbstractSqlQuery.CountWork
- All Implemented Interfaces:
- JdbcWork<Long>, Work
- Enclosing class:
- AbstractSqlQuery
class AbstractSqlQuery.CountWork
- extends ResultSetWork<Long>
Method Summary |
protected Long |
getResult(ResultSet rs)
This method needs to be overridden by subclasses to extract the
result from the ResultSet . |
protected void |
setParameters(PreparedStatement ps)
This method should be overridden by subclasses that needs to
set parameters on the statement that is going to be executed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parameterOrder
private List<String> parameterOrder
AbstractSqlQuery.CountWork
AbstractSqlQuery.CountWork(SessionControl sc,
String sql,
List<String> parameterOrder)
setParameters
protected void setParameters(PreparedStatement ps)
throws SQLException
- Description copied from class:
ResultSetWork
- This method should be overridden by subclasses that needs to
set parameters on the statement that is going to be executed.
The default implementation does nothing. This method is called
after the statement has been prepared with
Connection.prepareStatement(String)
and before it is executed
with PreparedStatement.executeUpdate()
.
- Overrides:
setParameters
in class ResultSetWork<Long>
- Parameters:
ps
- The prepared statement
- Throws:
SQLException
getResult
protected Long getResult(ResultSet rs)
throws SQLException
- Description copied from class:
ResultSetWork
- This method needs to be overridden by subclasses to extract the
result from the
ResultSet
. The result set will be closed
after the call to this method.
- Specified by:
getResult
in class ResultSetWork<Long>
- Parameters:
rs
- The result set to get the result from
- Throws:
SQLException