Package com.google.cloud.spanner
Class ForwardingResultSet
java.lang.Object
com.google.cloud.spanner.ForwardingStructReader
com.google.cloud.spanner.ForwardingResultSet
- All Implemented Interfaces:
ProtobufResultSet,ResultSet,StructReader,AutoCloseable
- Direct Known Subclasses:
ForwardingAsyncResultSet
Forwarding implementation of ResultSet that forwards all calls to a delegate.
-
Constructor Summary
ConstructorsConstructorDescriptionForwardingResultSet(ResultSet delegate) ForwardingResultSet(com.google.common.base.Supplier<? extends ResultSet> supplier) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanGetProtobufValue(int columnIndex) Returns true if the protobuf value for the given column is still available.voidclose()Explicitly close the result set, releasing any associated resources.Creates an immutable version of the row that the result set is positioned over.Returns theResultSetMetadatafor thisResultSet.com.google.protobuf.ValuegetProtobufValue(int columnIndex) Returns the column value as a protobuf value.getStats()Returns theResultSetStatsfor the query only if the query was executed in either thePLANor thePROFILEmode via theReadContext.analyzeQuery(Statement, com.google.cloud.spanner.ReadContext.QueryAnalyzeMode)method or for DML statements inReadContext.executeQuery(Statement, QueryOption...).booleannext()Advances the result set to the next row, returning false if no such row exists.Methods inherited from class com.google.cloud.spanner.ForwardingStructReader
checkValidState, getBigDecimal, getBigDecimal, getBigDecimalList, getBigDecimalList, getBoolean, getBoolean, getBooleanArray, getBooleanArray, getBooleanList, getBooleanList, getBytes, getBytes, getBytesList, getBytesList, getColumnCount, getColumnIndex, getColumnType, getColumnType, getDate, getDate, getDateList, getDateList, getDouble, getDouble, getDoubleArray, getDoubleArray, getDoubleList, getDoubleList, getFloat, getFloat, getFloatArray, getFloatArray, getFloatList, getFloatList, getJson, getJson, getJsonList, getJsonList, getLong, getLong, getLongArray, getLongArray, getLongList, getLongList, getPgJsonb, getPgJsonb, getPgJsonbList, getPgJsonbList, getProtoEnum, getProtoEnum, getProtoEnumList, getProtoEnumList, getProtoMessage, getProtoMessage, getProtoMessageList, getProtoMessageList, getString, getString, getStringList, getStringList, getStructList, getStructList, getTimestamp, getTimestamp, getTimestampList, getTimestampList, getType, getValue, getValue, isNull, isNullMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.cloud.spanner.StructReader
getBigDecimal, getBigDecimal, getBigDecimalList, getBigDecimalList, getBoolean, getBoolean, getBooleanArray, getBooleanArray, getBooleanList, getBooleanList, getBytes, getBytes, getBytesList, getBytesList, getColumnCount, getColumnIndex, getColumnType, getColumnType, getDate, getDate, getDateList, getDateList, getDouble, getDouble, getDoubleArray, getDoubleArray, getDoubleList, getDoubleList, getFloat, getFloat, getFloatArray, getFloatArray, getFloatList, getFloatList, getJson, getJson, getJsonList, getJsonList, getLong, getLong, getLongArray, getLongArray, getLongList, getLongList, getPgJsonb, getPgJsonb, getPgJsonbList, getPgJsonbList, getProtoEnum, getProtoEnum, getProtoEnumList, getProtoEnumList, getProtoMessage, getProtoMessage, getProtoMessageList, getProtoMessageList, getString, getString, getStringList, getStringList, getStructList, getStructList, getTimestamp, getTimestamp, getTimestampList, getTimestampList, getType, getValue, getValue, isNull, isNull
-
Constructor Details
-
ForwardingResultSet
-
ForwardingResultSet
-
-
Method Details
-
next
Description copied from interface:ResultSetAdvances the result set to the next row, returning false if no such row exists. This method may block.- Specified by:
nextin interfaceResultSet- Throws:
SpannerException
-
canGetProtobufValue
public boolean canGetProtobufValue(int columnIndex) Description copied from interface:ProtobufResultSetReturns true if the protobuf value for the given column is still available.- Specified by:
canGetProtobufValuein interfaceProtobufResultSet
-
getProtobufValue
public com.google.protobuf.Value getProtobufValue(int columnIndex) Description copied from interface:ProtobufResultSetReturns the column value as a protobuf value.This is an internal method not intended for external usage.
This method may only be called before the column value has been decoded to a plain Java object. This means that the
DecodeModethat is used for theResultSetmust be one ofDecodeMode.LAZY_PER_ROWandDecodeMode.LAZY_PER_COL, and that the correspondingStructReader.getValue(int),StructReader.getBoolean(int), ... method may not yet have been called for the column.- Specified by:
getProtobufValuein interfaceProtobufResultSet
-
getCurrentRowAsStruct
Description copied from interface:ResultSetCreates an immutable version of the row that the result set is positioned over. This may involve copying internal data structures, and so converting all rows toStructobjects is generally more expensive than processing theResultSetdirectly.- Specified by:
getCurrentRowAsStructin interfaceResultSet
-
close
public void close()Description copied from interface:ResultSetExplicitly close the result set, releasing any associated resources. This must always be called when disposing of aResultSetbeforeResultSet.next()has returnedfalseor raised an exception. Callingclose()is also allowed if the result set has been fully consumed, so a recommended practice is to unconditionally close the result set once it is done with, typically using a try-with-resources construct.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceResultSet
-
getStats
Description copied from interface:ResultSetReturns theResultSetStatsfor the query only if the query was executed in either thePLANor thePROFILEmode via theReadContext.analyzeQuery(Statement, com.google.cloud.spanner.ReadContext.QueryAnalyzeMode)method or for DML statements inReadContext.executeQuery(Statement, QueryOption...). Attempts to call this method on aResultSetnot obtained fromanalyzeQueryorexecuteQuerywill return anullResultSetStats. This method must be called afterResultSet.next()has returned @{code false}. Calling it before that will result innullResultSetStatstoo. -
getMetadata
Description copied from interface:ResultSetReturns theResultSetMetadatafor thisResultSet. This is method may only be called after callingResultSet.next()at least once.- Specified by:
getMetadatain interfaceResultSet
-