接口 Batch

  • 所有已知实现类:
    AbstractBatchImpl, BatchingBatch, NonBatchingBatch

    public interface Batch
    Conceptually models a batch.

    Unlike directly in JDBC, here we add the ability to batch together multiple statements at a time. In the underlying JDBC this correlates to multiple PreparedStatement objects (one for each DML string) maintained within the batch.

    作者:
    Steve Ebersole
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型 方法 说明
      void addObserver​(BatchObserver observer)
      Adds an observer to this batch.
      void addToBatch()
      Indicates completion of the current part of the batch.
      void execute()
      Execute this batch.
      PreparedStatement getBatchStatement​(String sql, boolean callable)
      Get a statement which is part of the batch, creating if necessary (and storing for next time).
      BatchKey getKey()
      Retrieves the object being used to key (uniquely identify) this batch.
      void release()
      Used to indicate that the batch instance is no longer needed and that, therefore, it can release its resources.
    • 方法详细资料

      • getKey

        BatchKey getKey()
        Retrieves the object being used to key (uniquely identify) this batch.
        返回:
        The batch key.
      • addObserver

        void addObserver​(BatchObserver observer)
        Adds an observer to this batch.
        参数:
        observer - The batch observer.
      • getBatchStatement

        PreparedStatement getBatchStatement​(String sql,
                                            boolean callable)
        Get a statement which is part of the batch, creating if necessary (and storing for next time).
        参数:
        sql - The SQL statement.
        callable - Is the SQL statement callable?
        返回:
        The prepared statement instance, representing the SQL statement.
      • addToBatch

        void addToBatch()
        Indicates completion of the current part of the batch.
      • execute

        void execute()
        Execute this batch.
      • release

        void release()
        Used to indicate that the batch instance is no longer needed and that, therefore, it can release its resources.