com.syrtsov.ddao
Interface SqlOperation

All Known Implementing Classes:
DeleteSqlOperation, InsertAndGetIdSqlOperation, InsertSqlOperation, SelectSqlOperation, UpdateSqlOperation

public interface SqlOperation

psdo: comments SqlOperation defines ability to execute SQL operation. Class that implements this interface has to be associated with corresponding annotation using SqlAnnotation. When DDao framework finds annotation that associates interface method with class implementing this interface it will instantiate that class and will initialize it with method information

Created by: Pavel Syrtsov Date: Apr 2, 2007 Time: 8:01:41 PM


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
 

Method Detail

invoke

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

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

void init(java.lang.reflect.Method method)
          throws InitializerException
initialize instance with data defined by annotations attached to given method

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