Class SpannerReadOptions
java.lang.Object
com.google.cloud.spring.data.spanner.core.AbstractSpannerRequestOptions<com.google.cloud.spanner.Options.ReadOption>
com.google.cloud.spring.data.spanner.core.SpannerReadOptions
- All Implemented Interfaces:
Serializable
public class SpannerReadOptions
extends AbstractSpannerRequestOptions<com.google.cloud.spanner.Options.ReadOption>
Encapsulates Cloud Spanner read options.
- Since:
- 1.1
- See Also:
-
Field Summary
Fields inherited from class com.google.cloud.spring.data.spanner.core.AbstractSpannerRequestOptions
requestOptions, requestOptionType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddReadOption(com.google.cloud.spanner.Options.ReadOption readOption) getIndex()setAllowPartialRead(boolean allowPartialRead) setIncludeProperties(Set<String> includeProperties) setTimestamp(com.google.cloud.Timestamp timestamp) setTimestampBound(com.google.cloud.spanner.TimestampBound timestampBound) Set if this query should be executed with bounded staleness.In many cases aSpannerReadOptionsclass instance could be compatible withSpannerQueryOptions.Methods inherited from class com.google.cloud.spring.data.spanner.core.AbstractSpannerRequestOptions
getIncludeProperties, getOptions, getTimestamp, getTimestampBound, isAllowPartialRead
-
Constructor Details
-
SpannerReadOptions
public SpannerReadOptions()Constructor to create an instance. Use the extension-style add/set functions to add options and settings.
-
-
Method Details
-
addReadOption
-
getIndex
-
setIndex
-
setIncludeProperties
- Overrides:
setIncludePropertiesin classAbstractSpannerRequestOptions<com.google.cloud.spanner.Options.ReadOption>
-
setTimestampBound
Description copied from class:AbstractSpannerRequestOptionsSet if this query should be executed with bounded staleness.- Overrides:
setTimestampBoundin classAbstractSpannerRequestOptions<com.google.cloud.spanner.Options.ReadOption>- Parameters:
timestampBound- the timestamp bound. Can be exact or bounded staleness.- Returns:
- this options object.
-
setTimestamp
- Overrides:
setTimestampin classAbstractSpannerRequestOptions<com.google.cloud.spanner.Options.ReadOption>
-
setAllowPartialRead
- Overrides:
setAllowPartialReadin classAbstractSpannerRequestOptions<com.google.cloud.spanner.Options.ReadOption>
-
toQueryOptions
In many cases aSpannerReadOptionsclass instance could be compatible withSpannerQueryOptions. The method executes such conversion or throws an exception if it's impossible.- Returns:
- query-parameters
- Throws:
IllegalArgumentException- whenSpannerQueryOptionscan't be converted toSpannerQueryOptions.
-