Class DefaultCommandHandler

    • Field Detail

      • sql

        protected net.sf.jkniv.sqlegance.Sql sql
      • overloadResultRow

        protected ResultRow<?,​?> overloadResultRow
      • handleableException

        protected net.sf.jkniv.exception.HandleableException handleableException
    • Constructor Detail

      • DefaultCommandHandler

        public DefaultCommandHandler​(CommandAdapter cmdAdapter)
    • Method Detail

      • with

        public CommandHandler with​(ResultRow<?,​?> overloadResultRow)
        Description copied from interface: CommandHandler
        Configure the life-cycle with a custom result parser rows of query.
        Specified by:
        with in interface CommandHandler
        Parameters:
        overloadResultRow - customized result row to parser
        Returns:
        a reference to this object.
      • with

        public CommandHandler with​(net.sf.jkniv.sqlegance.Sql sql)
        Description copied from interface: CommandHandler
        Configure the life-cycle with a Sql
        Specified by:
        with in interface CommandHandler
        Parameters:
        sql - Dynamic SQL
        Returns:
        a reference to this object.
      • with

        public CommandHandler with​(net.sf.jkniv.exception.HandleableException handlerException)
        Description copied from interface: CommandHandler
        Configure the life-cycle with the handler exception
        Specified by:
        with in interface CommandHandler
        Parameters:
        handlerException - rules to handler the all exceptions
        Returns:
        a reference to this object.
      • run

        public <T> T run()
        Description copied from interface: CommandHandler
        Execute the database command
        Specified by:
        run in interface CommandHandler
        Type Parameters:
        T - Generic type of return, example: rows affected by a command or list of objects.
        Returns:
        the result of the command execution
      • postCommit

        public CommandHandler postCommit()
        Description copied from interface: CommandHandler
        Invoke all post callback methods, configured to be executed after a successful commit, for the parameters of Queryable.
        Specified by:
        postCommit in interface CommandHandler
        Returns:
        a reference to this object.
      • checkSqlType

        public CommandHandler checkSqlType​(net.sf.jkniv.sqlegance.SqlType expected)
        Description copied from interface: CommandHandler
        If the command isn't the SQL type expected an illegal argument exception is throw.
        Specified by:
        checkSqlType in interface CommandHandler
        Parameters:
        expected - type of SQL expected
        Returns:
        a reference to this object.