Class CommandContainer

  • All Implemented Interfaces:
    java.lang.AutoCloseable, CommandInterface

    public class CommandContainer
    extends Command
    Represents a single SQL statements. It wraps a prepared statement.
    • Constructor Detail

      • CommandContainer

        public CommandContainer​(SessionLocal session,
                                java.lang.String sql,
                                Prepared prepared)
    • Method Detail

      • isTransactional

        public boolean isTransactional()
        Description copied from class: Command
        Check if this command is transactional. If it is not, then it forces the current transaction to commit.
        Specified by:
        isTransactional in class Command
        Returns:
        true if it is
      • isQuery

        public boolean isQuery()
        Description copied from class: Command
        Check if this command is a query.
        Specified by:
        isQuery in interface CommandInterface
        Specified by:
        isQuery in class Command
        Returns:
        true if it is
      • update

        public ResultWithGeneratedKeys update​(java.lang.Object generatedKeysRequest)
        Description copied from class: Command
        Execute an updating statement (for example insert, delete, or update), if this is possible.
        Specified by:
        update in class Command
        Parameters:
        generatedKeysRequest - false if generated keys are not needed, true if generated keys should be configured automatically, int[] to specify column indices to return generated keys from, or String[] to specify column names to return generated keys from
        Returns:
        the update count and generated keys, if any
      • query

        public ResultInterface query​(long maxrows)
        Description copied from class: Command
        Execute a query statement, if this is possible.
        Specified by:
        query in class Command
        Parameters:
        maxrows - the maximum number of rows returned
        Returns:
        the local result set
      • isReadOnly

        public boolean isReadOnly()
        Description copied from class: Command
        Check if this command is read only.
        Specified by:
        isReadOnly in class Command
        Returns:
        true if it is
      • queryMeta

        public ResultInterface queryMeta()
        Description copied from class: Command
        Get an empty result set containing the metadata.
        Specified by:
        queryMeta in class Command
        Returns:
        an empty result set
      • getCommandType

        public int getCommandType()
        Description copied from interface: CommandInterface
        Get command type.
        Returns:
        one of the constants above
      • getDependencies

        public java.util.Set<DbObject> getDependencies()
        Description copied from class: Command
        Collect all database objects, this command depends on
        Specified by:
        getDependencies in class Command
        Returns:
        Set of dependencies
      • invalidateCachedResult

        public void invalidateCachedResult​(Table reason)
        Description copied from class: Command
        Clear cached results of all prepared statements, which depends on a given table
        Specified by:
        invalidateCachedResult in class Command
        Parameters:
        reason - table causing invalidation
      • isRetryable

        protected boolean isRetryable()
        Description copied from class: Command
        Checks if this command can be repeated on locking failure.
        Specified by:
        isRetryable in class Command
        Returns:
        true if this command can be repeated on locking failure