Class ReadOption (2.32.3)

publicabstractclass ReadOptionimplementsSerializable

Specifies options for read operations in Datastore, namely getting/fetching entities and running queries.

Inheritance

java.lang.Object > ReadOption

Implements

Serializable

Static Methods

eventualConsistency()

publicstaticReadOption.EventualConsistencyeventualConsistency()

Returns a ReadOption that specifies eventual consistency, allowing Datastore to return stale results from gets, fetches, and ancestor queries.

Returns
Type Description
ReadOption.EventualConsistency

readTime(Timestamp time)

publicstaticReadOption.ReadTimereadTime(Timestamptime)

Returns a ReadOption that specifies read time, allowing Datastore to return results from lookups and queries at a particular timestamp. This feature is currently in private preview.

Parameter
Name Description
time com.google.cloud.Timestamp
Returns
Type Description
ReadOption.ReadTime

transactionId(ByteString transactionId)

publicstaticReadOptiontransactionId(ByteStringtransactionId)

Returns a ReadOption that specifies transaction id, allowing Datastore to execute a Query in this transaction.

Parameter
Name Description
transactionId ByteString
Returns
Type Description
ReadOption

transactionId(String transactionId)

publicstaticReadOptiontransactionId(StringtransactionId)

Returns a ReadOption that specifies transaction id, allowing Datastore to execute a Query in this transaction.

Parameter
Name Description
transactionId String
Returns
Type Description
ReadOption

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.