com.syrtsov.ddao.ops
Class InsertAndGetIdSqlOperation
java.lang.Object
com.syrtsov.ddao.ops.InsertAndGetIdSqlOperation
- All Implemented Interfaces:
- SqlOperation
public class InsertAndGetIdSqlOperation
- extends java.lang.Object
- implements SqlOperation
Created-By: Pavel Syrtsov
Date: Aug 11, 2007
Time: 2:47:16 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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InsertAndGetIdSqlOperation
public InsertAndGetIdSqlOperation()
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 operationmethod
- - Dao method object associated with this operation invocationargs
- - 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