public abstract class DefaultCommandHandler extends Object implements CommandHandler
| Modifier and Type | Field and Description |
|---|---|
protected HandleableException |
handleableException |
protected ResultRow<?,?> |
overloadResultRow |
protected Queryable |
queryable |
protected Sql |
sql |
| Constructor and Description |
|---|
DefaultCommandHandler(CommandAdapter cmdAdapter) |
| Modifier and Type | Method and Description |
|---|---|
CommandHandler |
checkSqlType(SqlType expected)
If the command isn't the SQL type expected an illegal argument exception is throw.
|
protected CommandAdapter |
getCommandAdapter() |
CommandHandler |
postCallback()
Invoke all post callback methods configured
for the parameters of
Queryable |
CommandHandler |
postCommit()
Invoke all post callback methods, configured to be
executed after a successful commit, for the
parameters of
Queryable. |
CommandHandler |
postException()
Invoke all post callback methods, configured to be
executed after a failure, for the parameters of
Queryable. |
CommandHandler |
preCallback()
Invoke all pre callback methods configured
for the parameters of
Queryable |
<T> T |
run()
Execute the database command
|
CommandHandler |
with(HandleableException handlerException)
Configure the life-cycle with the handler exception
|
CommandHandler |
with(Queryable queryable)
Configure the life-cycle with a
Queryable |
CommandHandler |
with(ResultRow<?,?> overloadResultRow)
Configure the life-cycle with a custom result parser rows of query.
|
CommandHandler |
with(Sql sql)
Configure the life-cycle with a
Sql |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasCommandprotected ResultRow<?,?> overloadResultRow
protected HandleableException handleableException
public DefaultCommandHandler(CommandAdapter cmdAdapter)
public CommandHandler with(ResultRow<?,?> overloadResultRow)
CommandHandlerwith in interface CommandHandleroverloadResultRow - customized result row to parserpublic CommandHandler with(Queryable queryable)
CommandHandlerQueryablewith in interface CommandHandlerqueryable - query name and yours parameterspublic CommandHandler with(Sql sql)
CommandHandlerSqlwith in interface CommandHandlersql - Dynamic SQLpublic CommandHandler with(HandleableException handlerException)
CommandHandlerwith in interface CommandHandlerhandlerException - rules to handler the all exceptionspublic <T> T run()
CommandHandlerrun in interface CommandHandlerT - Generic type of return, example: rows affected by a command or list of objects.protected CommandAdapter getCommandAdapter()
public CommandHandler preCallback()
CommandHandlerQueryablepreCallback in interface CommandHandlerpublic CommandHandler postCallback()
CommandHandlerQueryablepostCallback in interface CommandHandlerpublic CommandHandler postCommit()
CommandHandlerQueryable.postCommit in interface CommandHandlerpublic CommandHandler postException()
CommandHandlerQueryable.postException in interface CommandHandlerpublic CommandHandler checkSqlType(SqlType expected)
CommandHandlercheckSqlType in interface CommandHandlerexpected - type of SQL expectedCopyright © 2012–2020 jkniv, copyleft code. All rights reserved.