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, wait
asCommand
protected ResultRow<?,?> overloadResultRow
protected HandleableException handleableException
public DefaultCommandHandler(CommandAdapter cmdAdapter)
public CommandHandler with(ResultRow<?,?> overloadResultRow)
CommandHandler
with
in interface CommandHandler
overloadResultRow
- customized result row to parserpublic CommandHandler with(Queryable queryable)
CommandHandler
Queryable
with
in interface CommandHandler
queryable
- query name and yours parameterspublic CommandHandler with(Sql sql)
CommandHandler
Sql
with
in interface CommandHandler
sql
- Dynamic SQLpublic CommandHandler with(HandleableException handlerException)
CommandHandler
with
in interface CommandHandler
handlerException
- rules to handler the all exceptionspublic <T> T run()
CommandHandler
run
in interface CommandHandler
T
- Generic type of return, example: rows affected by a command or list of objects.protected CommandAdapter getCommandAdapter()
public CommandHandler preCallback()
CommandHandler
Queryable
preCallback
in interface CommandHandler
public CommandHandler postCallback()
CommandHandler
Queryable
postCallback
in interface CommandHandler
public CommandHandler postCommit()
CommandHandler
Queryable
.postCommit
in interface CommandHandler
public CommandHandler postException()
CommandHandler
Queryable
.postException
in interface CommandHandler
public CommandHandler checkSqlType(SqlType expected)
CommandHandler
checkSqlType
in interface CommandHandler
expected
- type of SQL expectedCopyright © 2012–2020 jkniv, copyleft code. All rights reserved.