com.google.appengine.api.datastore

## Class TransactionOptions.Builder

- java.lang.Object
- - com.google.appengine.api.datastore.TransactionOptions.Builder

- Enclosing class:
    TransactionOptions

      public static final class TransactionOptions.Builder
      extends java.lang.Object

  Contains static creation methods for `TransactionOptions`.

- - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TransactionOptions` | `allowMultipleEntityGroups(boolean enable)` Deprecated. Use `Builder.withDefaults().setXG(enable)` instead.
    `static TransactionOptions` | `withDefaults()` Helper method for creating a `TransactionOptions` instance with default values.
    `static TransactionOptions` | `withPreviousTransaction(Transaction previousTransaction)` Shorthand for `TransactionOptions.withTransactionMode(Mode.READ_WRITE).setPreviousTransaction(...);`
    `static TransactionOptions` | `withTransactionMode(TransactionOptions.Mode mode)` Shorthand for `TransactionOptions.withDefaults().setTransactionMode(...);`
    `static TransactionOptions` | `withXG(boolean enable)` Create a `TransactionOptions` that enables or disables the use of cross-group transactions.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### withXG

          public static TransactionOptions withXG(boolean enable)

      Create a `TransactionOptions` that enables or disables the use of cross-group transactions. Shorthand for `TransactionOptions.withDefaults().setXG(...);`
      Parameters:
        `enable` - true to allow cross-group transactions, false to restrict transactions to a single entity group.
      Returns:
        `this` (for chaining)

    - #### withTransactionMode

          public static TransactionOptions withTransactionMode(TransactionOptions.Mode mode)

      Shorthand for `TransactionOptions.withDefaults().setTransactionMode(...);`

    - #### withPreviousTransaction

          public static TransactionOptions withPreviousTransaction(Transaction previousTransaction)

      Shorthand for `TransactionOptions.withTransactionMode(Mode.READ_WRITE).setPreviousTransaction(...);`

    - #### allowMultipleEntityGroups

          @Deprecated
          public static TransactionOptions allowMultipleEntityGroups(boolean enable)

      Deprecated. Use `Builder.withDefaults().setXG(enable)` instead.
      See `withXG(boolean)`.

    - #### withDefaults

          public static TransactionOptions withDefaults()

      Helper method for creating a `TransactionOptions` instance with default values. The defaults is false (disabled) for XG.