Interface CommandHandler

    • Method Detail

      • with

        CommandHandler with​(Queryable queryable)
        Configure the life-cycle with a Queryable
        Parameters:
        queryable - query name and yours parameters
        Returns:
        a reference to this object.
      • with

        CommandHandler with​(net.sf.jkniv.sqlegance.Sql sql)
        Configure the life-cycle with a Sql
        Parameters:
        sql - Dynamic SQL
        Returns:
        a reference to this object.
      • with

        CommandHandler with​(ResultRow<?,​?> customResultRow)
        Configure the life-cycle with a custom result parser rows of query.
        Parameters:
        customResultRow - customized result row to parser
        Returns:
        a reference to this object.
      • with

        CommandHandler with​(net.sf.jkniv.exception.HandleableException handlerException)
        Configure the life-cycle with the handler exception
        Parameters:
        handlerException - rules to handler the all exceptions
        Returns:
        a reference to this object.
      • asCommand

        Command asCommand()
        Retrieve the command implementation for the Repository like: Update, Select, Batch etc
        Returns:
        the specific implementation for the command.
      • preCallback

        CommandHandler preCallback()
        Invoke all pre callback methods configured for the parameters of Queryable
        Returns:
        a reference to this object.
      • postCallback

        CommandHandler postCallback()
        Invoke all post callback methods configured for the parameters of Queryable
        Returns:
        a reference to this object.
      • postCommit

        CommandHandler postCommit()
        Invoke all post callback methods, configured to be executed after a successful commit, for the parameters of Queryable.
        Returns:
        a reference to this object.
      • postException

        CommandHandler postException()
        Invoke all post callback methods, configured to be executed after a failure, for the parameters of Queryable.
        Returns:
        a reference to this object.
      • run

        <T> T run()
        Execute the database command
        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

        CommandHandler checkSqlType​(net.sf.jkniv.sqlegance.SqlType expected)
        If the command isn't the SQL type expected an illegal argument exception is throw.
        Parameters:
        expected - type of SQL expected
        Returns:
        a reference to this object.
        Throws:
        IllegalArgumentException - if Sql isn't the expected SqlType