Package com.google.cloud.spanner
Class ForwardingResultSet
java.lang.Object
com.google.cloud.spanner.ForwardingStructReader
com.google.cloud.spanner.ForwardingResultSet
- All Implemented Interfaces:
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<ResultSet> supplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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.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, 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, 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
-
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
-