Class ReadOption (2.21.1)

public abstract class ReadOption implements Serializable

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

Inheritance

java.lang.Object > ReadOption

Implements

Serializable

Static Methods

eventualConsistency()

public static ReadOption.EventualConsistency eventualConsistency()

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)

public static ReadOption.ReadTime readTime(Timestamp time)

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)

public static ReadOption transactionId(ByteString transactionId)

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)

public static ReadOption transactionId(String transactionId)

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