Class NoCommand

  • All Implemented Interfaces:
    Command

    public class NoCommand
    extends Object
    implements Command
    Dummy/Empty implementation for Command
    Since:
    0.6.0
    Author:
    Alisson Gomes
    • Constructor Detail

      • NoCommand

        public NoCommand()
    • Method Detail

      • getInstance

        public static Command getInstance()
      • with

        public Command with​(net.sf.jkniv.exception.HandleableException handleableException)
        Description copied from interface: Command
        Configure the handler exception for the command
        Specified by:
        with in interface Command
        Parameters:
        handleableException - rules to handler the all exceptions
        Returns:
        a reference to this object.
      • with

        public Command with​(CommandHandler commandHandler)
        Description copied from interface: Command
        Configure the life-cycle of command
        Specified by:
        with in interface Command
        Parameters:
        commandHandler - the life-cycle of command handler
        Returns:
        a reference to this object.
      • execute

        public <T> T execute()
        Description copied from interface: Command
        Execute the database statement could be a Command or a Query
        Specified by:
        execute in interface Command
        Type Parameters:
        T - Generic type of return, example: rows affected by a command or list of objects.
        Returns:
        the result of the statement execution
      • with

        public <T> Command with​(T stmt)
        Description copied from interface: Command
        The statement to run this command
        Specified by:
        with in interface Command
        Type Parameters:
        T - Type responsible to execute the statement into database. For example: Statement for JDBC or Cassandra, EntityManager for JPA, bucket for Couchbase etc
        Parameters:
        stmt - a statement implementation to run the command.
        Returns:
        a reference to this object.