Annotation Type Transactional


@InterceptorBinding @Target({METHOD,TYPE}) @Retention(RUNTIME) public @interface Transactional
Adds transaction demarcation to the annotated method.
Author:
Frank David Martínez
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    org.apache.ibatis.session.ExecutorType
    Returns the constant indicating the myBatis executor type.
    boolean
    Flag to indicate that myBatis has to force the transaction commit().
    Returns the constant indicating the transaction isolation level.
    Class<? extends Throwable>[]
    Defines zero (0) or more exception Class classes, which must be a subclass of Throwable, indicating which exception types must cause a transaction rollback.
    boolean
    If true, the transaction will never committed but rather rolled back, useful for testing purposes.
  • Element Details

    • executorType

      org.apache.ibatis.session.ExecutorType executorType
      Returns the constant indicating the myBatis executor type.
      Returns:
      ExecutorType.SIMPLE by default, user defined otherwise.
      Default:
      SIMPLE
    • isolation

      Isolation isolation
      Returns the constant indicating the transaction isolation level.
      Returns:
      Isolation.DEFAULT by default, user defined otherwise.
      Default:
      DEFAULT
    • force

      boolean force
      Flag to indicate that myBatis has to force the transaction commit().
      Returns:
      false by default, user defined otherwise.
      Default:
      false
    • rollbackOnly

      boolean rollbackOnly
      If true, the transaction will never committed but rather rolled back, useful for testing purposes.
      Returns:
      false by default, user defined otherwise.
      Default:
      false
    • rollbackFor

      Class<? extends Throwable>[] rollbackFor
      Defines zero (0) or more exception Class classes, which must be a subclass of Throwable, indicating which exception types must cause a transaction rollback.
      Returns:
      an empty array by default, user defined otherwise.
      Default:
      {}