com.syrtsov.ddao.ops
Class SelectSqlOperation

java.lang.Object
  extended by com.syrtsov.ddao.ops.SelectSqlOperation
All Implemented Interfaces:
SqlOperation

public class SelectSqlOperation
extends java.lang.Object
implements SqlOperation

Created by: Pavel Syrtsov Date: Apr 2, 2007 Time: 8:10:29 PM


Constructor Summary
SelectSqlOperation()
           
 
Method Summary
 void init(java.lang.reflect.Method method)
          initialize instance with data defined by annotations attached to given method
 java.lang.Object invoke(java.sql.Connection connection, java.lang.reflect.Method method, java.lang.Object[] args)
          this method executes SQL operation and returns result mapped to java object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectSqlOperation

public SelectSqlOperation()
Method Detail

invoke

public java.lang.Object invoke(java.sql.Connection connection,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
Description copied from interface: SqlOperation
this method executes SQL operation and returns result mapped to java object

Specified by:
invoke in interface SqlOperation
Parameters:
connection - - JDBC connection that should be used to execute operation
method - - Dao method object associated with this operation invocation
args - - argument array given with Dao method invocation
Returns:
result of query execution mapped to java object

init

public void init(java.lang.reflect.Method method)
          throws InitializerException
Description copied from interface: SqlOperation
initialize instance with data defined by annotations attached to given method

Specified by:
init in interface SqlOperation
Parameters:
method - - method that should be used to initialize this operation, usually we use annotation attached to this method and that annotation has SQL
Throws:
InitializerException - - thrown when given method can not be used to initialize this operation