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
-
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 aSpannerReadOptions
class 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:
setIncludeProperties
in classAbstractSpannerRequestOptions<com.google.cloud.spanner.Options.ReadOption>
-
setTimestampBound
Description copied from class:AbstractSpannerRequestOptions
Set if this query should be executed with bounded staleness.- Overrides:
setTimestampBound
in classAbstractSpannerRequestOptions<com.google.cloud.spanner.Options.ReadOption>
- Parameters:
timestampBound
- the timestamp bound. Can be exact or bounded staleness.- Returns:
- this options object.
-
setTimestamp
- Overrides:
setTimestamp
in classAbstractSpannerRequestOptions<com.google.cloud.spanner.Options.ReadOption>
-
setAllowPartialRead
- Overrides:
setAllowPartialRead
in classAbstractSpannerRequestOptions<com.google.cloud.spanner.Options.ReadOption>
-
toQueryOptions
In many cases aSpannerReadOptions
class instance could be compatible withSpannerQueryOptions
. The method executes such conversion or throws an exception if it's impossible.- Returns:
- query-parameters
- Throws:
IllegalArgumentException
- whenSpannerQueryOptions
can't be converted toSpannerQueryOptions
.
-