Package net.sf.jkniv.whinstone.commands
Interface Command
-
- All Known Implementing Classes:
NoCommand
public interface CommandCommand to be executed in database likeSelect,Update,Delete,Insert,Stored Procedure...- Since:
- 0.6.0
- Author:
- Alisson Gomes
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Texecute()Execute the database statement could be aCommandor aQueryCommandwith(net.sf.jkniv.exception.HandleableException handlerException)Configure the handler exception for the commandCommandwith(CommandHandler commandHandler)Configure the life-cycle of command<T> Commandwith(T stmt)The statement to run this command
-
-
-
Method Detail
-
with
Command with(net.sf.jkniv.exception.HandleableException handlerException)
Configure the handler exception for the command- Parameters:
handlerException- rules to handler the all exceptions- Returns:
- a reference to this object.
-
with
Command with(CommandHandler commandHandler)
Configure the life-cycle of command- Parameters:
commandHandler- the life-cycle of command handler- Returns:
- a reference to this object.
-
with
<T> Command with(T stmt)
The statement to run this command- Type Parameters:
T- Type responsible to execute the statement into database. For example:Statementfor JDBC or Cassandra,EntityManagerfor JPA,bucketfor Couchbase etc- Parameters:
stmt- a statement implementation to run the command.- Returns:
- a reference to this object.
-
execute
<T> T execute()
Execute the database statement could be aCommandor aQuery- Type Parameters:
T- Generic type of return, example: rows affected by a command or list of objects.- Returns:
- the result of the statement execution
-
-