Class CommitRequest (2.23.0)

publicfinalclass CommitRequestextendsGeneratedMessageV3implementsCommitRequestOrBuilder

The request for Datastore.Commit.

Protobuf type google.datastore.v1.CommitRequest

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

DATABASE_ID_FIELD_NUMBER

publicstaticfinalintDATABASE_ID_FIELD_NUMBER
Field Value
Type Description
int

MODE_FIELD_NUMBER

publicstaticfinalintMODE_FIELD_NUMBER
Field Value
Type Description
int

MUTATIONS_FIELD_NUMBER

publicstaticfinalintMUTATIONS_FIELD_NUMBER
Field Value
Type Description
int

PROJECT_ID_FIELD_NUMBER

publicstaticfinalintPROJECT_ID_FIELD_NUMBER
Field Value
Type Description
int

SINGLE_USE_TRANSACTION_FIELD_NUMBER

publicstaticfinalintSINGLE_USE_TRANSACTION_FIELD_NUMBER
Field Value
Type Description
int

TRANSACTION_FIELD_NUMBER

publicstaticfinalintTRANSACTION_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticCommitRequestgetDefaultInstance()
Returns
Type Description
CommitRequest

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticCommitRequest.BuildernewBuilder()
Returns
Type Description
CommitRequest.Builder

newBuilder(CommitRequest prototype)

publicstaticCommitRequest.BuildernewBuilder(CommitRequestprototype)
Parameter
Name Description
prototype CommitRequest
Returns
Type Description
CommitRequest.Builder

parseDelimitedFrom(InputStream input)

publicstaticCommitRequestparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticCommitRequestparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticCommitRequestparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticCommitRequestparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticCommitRequestparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticCommitRequestparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticCommitRequestparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticCommitRequestparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticCommitRequestparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticCommitRequestparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticCommitRequestparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticCommitRequestparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<CommitRequest>parser()
Returns
Type Description
Parser<CommitRequest>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDatabaseId()

publicStringgetDatabaseId()

The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default database.

string database_id = 9;

Returns
Type Description
String

The databaseId.

getDatabaseIdBytes()

publicByteStringgetDatabaseIdBytes()

The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default database.

string database_id = 9;

Returns
Type Description
ByteString

The bytes for databaseId.

getDefaultInstanceForType()

publicCommitRequestgetDefaultInstanceForType()
Returns
Type Description
CommitRequest

getMode()

publicCommitRequest.ModegetMode()

The type of commit to perform. Defaults to TRANSACTIONAL.

.google.datastore.v1.CommitRequest.Mode mode = 5;

Returns
Type Description
CommitRequest.Mode

The mode.

getModeValue()

publicintgetModeValue()

The type of commit to perform. Defaults to TRANSACTIONAL.

.google.datastore.v1.CommitRequest.Mode mode = 5;

Returns
Type Description
int

The enum numeric value on the wire for mode.

getMutations(int index)

publicMutationgetMutations(intindex)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameter
Name Description
index int
Returns
Type Description
Mutation

getMutationsCount()

publicintgetMutationsCount()

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Returns
Type Description
int

getMutationsList()

publicList<Mutation>getMutationsList()

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Returns
Type Description
List<Mutation>

getMutationsOrBuilder(int index)

publicMutationOrBuildergetMutationsOrBuilder(intindex)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameter
Name Description
index int
Returns
Type Description
MutationOrBuilder

getMutationsOrBuilderList()

publicList<?extendsMutationOrBuilder>getMutationsOrBuilderList()

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Returns
Type Description
List<? extends com.google.datastore.v1.MutationOrBuilder>

getParserForType()

publicParser<CommitRequest>getParserForType()
Returns
Type Description
Parser<CommitRequest>
Overrides

getProjectId()

publicStringgetProjectId()

Required. The ID of the project against which to make the request.

string project_id = 8 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The projectId.

getProjectIdBytes()

publicByteStringgetProjectIdBytes()

Required. The ID of the project against which to make the request.

string project_id = 8 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for projectId.

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getSingleUseTransaction()

publicTransactionOptionsgetSingleUseTransaction()

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Returns
Type Description
TransactionOptions

The singleUseTransaction.

getSingleUseTransactionOrBuilder()

publicTransactionOptionsOrBuildergetSingleUseTransactionOrBuilder()

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Returns
Type Description
TransactionOptionsOrBuilder

getTransaction()

publicByteStringgetTransaction()

The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to Datastore.BeginTransaction.

bytes transaction = 1;

Returns
Type Description
ByteString

The transaction.

getTransactionSelectorCase()

publicCommitRequest.TransactionSelectorCasegetTransactionSelectorCase()
Returns
Type Description
CommitRequest.TransactionSelectorCase

hasSingleUseTransaction()

publicbooleanhasSingleUseTransaction()

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Returns
Type Description
boolean

Whether the singleUseTransaction field is set.

hasTransaction()

publicbooleanhasTransaction()

The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to Datastore.BeginTransaction.

bytes transaction = 1;

Returns
Type Description
boolean

Whether the transaction field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicCommitRequest.BuildernewBuilderForType()
Returns
Type Description
CommitRequest.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedCommitRequest.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CommitRequest.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicCommitRequest.BuildertoBuilder()
Returns
Type Description
CommitRequest.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.