Google Cloud Platform
Java

TransactionOptions (Google App Engine API for Java)

com.google.appengine.api.datastore

Class TransactionOptions

  • java.lang.Object
    • com.google.appengine.api.datastore.TransactionOptions


  • public final class TransactionOptions
    extends java.lang.Object
    Describes options for transactions, passed at transaction creation time.

    XG is a boolean that enables or disables the use of cross-group transactions.

    Notes on usage:
    The recommended way to instantiate a TransactionsOptions object is to statically import TransactionOptions.Builder.* and invoke a static creation method followed by an instance mutator (if needed):

     import static com.google.appengine.api.datastore.TransactionOptions.Builder.*;
    
     ...
    
     datastoreService.beginTransaction(withXG(true));
     
    • Method Detail

      • setXG

        public TransactionOptions setXG(boolean enable)
        Enable or disable the use of cross-group transactions.
        Parameters:
        enable - true to cross-group transactions, false to restrict transactions to a single entity group.
        Returns:
        this (for chaining)
      • clearXG

        public TransactionOptions clearXG()
        Return the cross-group transaction setting to default (disabled).
      • isXG

        public boolean isXG()
        Returns:
        true if cross-group transactions are allowed, false if they are not allowed.
      • allowsMultipleEntityGroups

        @Deprecated
        public java.lang.Boolean allowsMultipleEntityGroups()
        Deprecated. 
        See Also:
        isXG()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object