Annotation Interface BatchUpdate


@Target(METHOD) @Retention(RUNTIME) public @interface BatchUpdate
Indicates a method that performs batch update operations on multiple entities.

This annotation enables efficient updating of multiple database records in a single batch operation.

The annotated method must be a member of a Dao annotated interface.

 @Entity
 public class Employee {
     ...
 }

 @Dao
 public interface EmployeeDao {

     @BatchUpdate
     int[] update(List<Employee> employee);
 }
 
The method may throw following exceptions:
  • Element Details

    • sqlFile

      boolean sqlFile
      Returns:
      whether an annotated method is mapped to an SQL file.
      Default:
      false
    • queryTimeout

      int queryTimeout
      The query timeout in seconds.

      If not specified, Config.getQueryTimeout() is used.

      Returns:
      the query timeout
      See Also:
      Default:
      -1
    • batchSize

      int batchSize
      The batch size.

      If not specified, Config.getBatchSize() is used.

      This value is used when Statement.executeBatch() is executed.

      Returns:
      the batch size
      See Also:
      Default:
      -1
    • ignoreVersion

      boolean ignoreVersion
      Whether the version property is ignored.

      If true, the column that mapped to the version property is excluded from SQL UPDATE statements.

      Returns:
      whether the version property is ignored
      Default:
      false
    • include

      String[] include
      The properties whose mapped columns are included in SQL UPDATE statements.

      Only if sqlFile() is false, this value is used.

      Returns:
      the included properties
      Default:
      {}
    • exclude

      String[] exclude
      The properties whose mapped columns are excluded from SQL UPDATE statements.

      Only if sqlFile() is false, this value is used.

      Returns:
      excluded properties
      Default:
      {}
    • suppressOptimisticLockException

      boolean suppressOptimisticLockException
      Whether OptimisticLockException is suppressed.

      Only if sqlFile() is false, this element value is used.

      Returns:
      whether OptimisticLockException is suppressed
      Default:
      false
    • sqlLog

      SqlLogType sqlLog
      Returns:
      the output format of SQL logs.
      Default:
      FORMATTED