Package st.orm

Record Class TransactionOptions

java.lang.Object
java.lang.Record
st.orm.TransactionOptions
Record Components:
propagation - how the block relates to an already active transaction.
isolation - the isolation level.
timeoutSeconds - the transaction timeout in seconds.
readOnly - whether the transaction is read-only.

public record TransactionOptions(TransactionPropagation propagation, TransactionIsolation isolation, Integer timeoutSeconds, Boolean readOnly) extends Record
Options for a transactional block. A null component means the option is inherited from the surrounding defaults: the thread-scoped options, then the global options, then the baseline (TransactionPropagation.REQUIRED, provider-default isolation and timeout, read-write).
Since:
1.13
  • Constructor Details

  • Method Details

    • defaults

      public static TransactionOptions defaults()
      Options with every field inherited from the surrounding defaults.
    • withPropagation

      public TransactionOptions withPropagation(TransactionPropagation propagation)
    • withIsolation

      public TransactionOptions withIsolation(TransactionIsolation isolation)
    • withTimeoutSeconds

      public TransactionOptions withTimeoutSeconds(int timeoutSeconds)
    • withReadOnly

      public TransactionOptions withReadOnly(boolean readOnly)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • propagation

      public TransactionPropagation propagation()
      Returns the value of the propagation record component.
      Returns:
      the value of the propagation record component
    • isolation

      public TransactionIsolation isolation()
      Returns the value of the isolation record component.
      Returns:
      the value of the isolation record component
    • timeoutSeconds

      public Integer timeoutSeconds()
      Returns the value of the timeoutSeconds record component.
      Returns:
      the value of the timeoutSeconds record component
    • readOnly

      public Boolean readOnly()
      Returns the value of the readOnly record component.
      Returns:
      the value of the readOnly record component