3.2.1: 2012-12-13

net.sf.basedb.core
Class AbstractSqlQuery.CountWork

java.lang.Object
  extended by net.sf.basedb.core.hibernate.ResultSetWork<Long>
      extended by net.sf.basedb.core.AbstractSqlQuery.CountWork
All Implemented Interfaces:
JdbcWork<Long>, Work
Enclosing class:
AbstractSqlQuery

 class AbstractSqlQuery.CountWork
extends ResultSetWork<Long>


Field Summary
private  List<String> parameterOrder
           
 
Constructor Summary
AbstractSqlQuery.CountWork(SessionControl sc, String sql, List<String> parameterOrder)
           
 
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 net.sf.basedb.core.hibernate.ResultSetWork
execute, getResult, getSql
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameterOrder

private List<String> parameterOrder
Constructor Detail

AbstractSqlQuery.CountWork

AbstractSqlQuery.CountWork(SessionControl sc,
                           String sql,
                           List<String> parameterOrder)
Method Detail

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

3.2.1: 2012-12-13