com.google.api.services.spanner.v1.model.TransactionSelector Maven / Gradle / Ivy
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.spanner.v1.model;
/**
* This message is used to select the transaction in which a Read or ExecuteSql call runs. See
* TransactionOptions for more information about transactions.
*
* This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Cloud Spanner API. For a detailed explanation see:
* https://developers.google.com/api-client-library/java/google-http-java-client/json
*
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class TransactionSelector extends com.google.api.client.json.GenericJson {
/**
* Begin a new transaction and execute this read or SQL query in it. The transaction ID of the new
* transaction is returned in ResultSetMetadata.transaction, which is a Transaction.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private TransactionOptions begin;
/**
* Execute the read or SQL query in a previously-started transaction.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String id;
/**
* Execute the read or SQL query in a temporary transaction. This is the most efficient way to
* execute a transaction that consists of a single SQL query.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private TransactionOptions singleUse;
/**
* Begin a new transaction and execute this read or SQL query in it. The transaction ID of the new
* transaction is returned in ResultSetMetadata.transaction, which is a Transaction.
* @return value or {@code null} for none
*/
public TransactionOptions getBegin() {
return begin;
}
/**
* Begin a new transaction and execute this read or SQL query in it. The transaction ID of the new
* transaction is returned in ResultSetMetadata.transaction, which is a Transaction.
* @param begin begin or {@code null} for none
*/
public TransactionSelector setBegin(TransactionOptions begin) {
this.begin = begin;
return this;
}
/**
* Execute the read or SQL query in a previously-started transaction.
* @see #decodeId()
* @return value or {@code null} for none
*/
public java.lang.String getId() {
return id;
}
/**
* Execute the read or SQL query in a previously-started transaction.
* @see #getId()
* @return Base64 decoded value or {@code null} for none
*
* @since 1.14
*/
public byte[] decodeId() {
return com.google.api.client.util.Base64.decodeBase64(id);
}
/**
* Execute the read or SQL query in a previously-started transaction.
* @see #encodeId()
* @param id id or {@code null} for none
*/
public TransactionSelector setId(java.lang.String id) {
this.id = id;
return this;
}
/**
* Execute the read or SQL query in a previously-started transaction.
* @see #setId()
*
*
* The value is encoded Base64 or {@code null} for none.
*
*
* @since 1.14
*/
public TransactionSelector encodeId(byte[] id) {
this.id = com.google.api.client.util.Base64.encodeBase64URLSafeString(id);
return this;
}
/**
* Execute the read or SQL query in a temporary transaction. This is the most efficient way to
* execute a transaction that consists of a single SQL query.
* @return value or {@code null} for none
*/
public TransactionOptions getSingleUse() {
return singleUse;
}
/**
* Execute the read or SQL query in a temporary transaction. This is the most efficient way to
* execute a transaction that consists of a single SQL query.
* @param singleUse singleUse or {@code null} for none
*/
public TransactionSelector setSingleUse(TransactionOptions singleUse) {
this.singleUse = singleUse;
return this;
}
@Override
public TransactionSelector set(String fieldName, Object value) {
return (TransactionSelector) super.set(fieldName, value);
}
@Override
public TransactionSelector clone() {
return (TransactionSelector) super.clone();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy