Package net.sf.jkniv.whinstone.commands
Class NoCommandHandler
- java.lang.Object
-
- net.sf.jkniv.whinstone.commands.NoCommandHandler
-
- All Implemented Interfaces:
CommandHandler
public class NoCommandHandler extends Object implements CommandHandler
Dummy/Empty implementation forCommandHandler- Since:
- 0.6.0
- Author:
- Alisson Gomes
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CommandasCommand()Retrieve the command implementation for the Repository like: Update, Select, Batch etcCommandHandlercheckSqlType(net.sf.jkniv.sqlegance.SqlType expected)If the command isn't the SQL type expected an illegal argument exception is throw.static CommandHandlergetInstance()CommandHandlerpostCallback()Invoke all post callback methods configured for the parameters ofQueryableCommandHandlerpostCommit()Invoke all post callback methods, configured to be executed after a successful commit, for the parameters ofQueryable.CommandHandlerpostException()Invoke all post callback methods, configured to be executed after a failure, for the parameters ofQueryable.CommandHandlerpreCallback()Invoke all pre callback methods configured for the parameters ofQueryable<T> Trun()Execute the database commandCommandHandlerwith(net.sf.jkniv.exception.HandleableException handlerException)Configure the life-cycle with the handler exceptionCommandHandlerwith(net.sf.jkniv.sqlegance.Sql sql)Configure the life-cycle with aSqlCommandHandlerwith(Queryable queryable)Configure the life-cycle with aQueryableCommandHandlerwith(ResultRow<?,?> overloadResultRow)Configure the life-cycle with a custom result parser rows of query.
-
-
-
Method Detail
-
getInstance
public static CommandHandler getInstance()
-
with
public CommandHandler with(ResultRow<?,?> overloadResultRow)
Description copied from interface:CommandHandlerConfigure the life-cycle with a custom result parser rows of query.- Specified by:
within interfaceCommandHandler- Parameters:
overloadResultRow- customized result row to parser- Returns:
- a reference to this object.
-
with
public CommandHandler with(Queryable queryable)
Description copied from interface:CommandHandlerConfigure the life-cycle with aQueryable- Specified by:
within interfaceCommandHandler- Parameters:
queryable- query name and yours parameters- Returns:
- a reference to this object.
-
with
public CommandHandler with(net.sf.jkniv.sqlegance.Sql sql)
Description copied from interface:CommandHandlerConfigure the life-cycle with aSql- Specified by:
within interfaceCommandHandler- Parameters:
sql- Dynamic SQL- Returns:
- a reference to this object.
-
with
public CommandHandler with(net.sf.jkniv.exception.HandleableException handlerException)
Description copied from interface:CommandHandlerConfigure the life-cycle with the handler exception- Specified by:
within interfaceCommandHandler- Parameters:
handlerException- rules to handler the all exceptions- Returns:
- a reference to this object.
-
asCommand
public Command asCommand()
Description copied from interface:CommandHandlerRetrieve the command implementation for the Repository like: Update, Select, Batch etc- Specified by:
asCommandin interfaceCommandHandler- Returns:
- the specific implementation for the command.
-
preCallback
public CommandHandler preCallback()
Description copied from interface:CommandHandlerInvoke all pre callback methods configured for the parameters ofQueryable- Specified by:
preCallbackin interfaceCommandHandler- Returns:
- a reference to this object.
-
postCallback
public CommandHandler postCallback()
Description copied from interface:CommandHandlerInvoke all post callback methods configured for the parameters ofQueryable- Specified by:
postCallbackin interfaceCommandHandler- Returns:
- a reference to this object.
-
postCommit
public CommandHandler postCommit()
Description copied from interface:CommandHandlerInvoke all post callback methods, configured to be executed after a successful commit, for the parameters ofQueryable.- Specified by:
postCommitin interfaceCommandHandler- Returns:
- a reference to this object.
-
postException
public CommandHandler postException()
Description copied from interface:CommandHandlerInvoke all post callback methods, configured to be executed after a failure, for the parameters ofQueryable.- Specified by:
postExceptionin interfaceCommandHandler- Returns:
- a reference to this object.
-
run
public <T> T run()
Description copied from interface:CommandHandlerExecute the database command- Specified by:
runin interfaceCommandHandler- Type Parameters:
T- Generic type of return, example: rows affected by a command or list of objects.- Returns:
- the result of the command execution
-
checkSqlType
public CommandHandler checkSqlType(net.sf.jkniv.sqlegance.SqlType expected)
Description copied from interface:CommandHandlerIf the command isn't the SQL type expected an illegal argument exception is throw.- Specified by:
checkSqlTypein interfaceCommandHandler- Parameters:
expected- type of SQL expected- Returns:
- a reference to this object.
-
-