@Immutable public abstract class Struct extends AbstractStructReader implements Serializable
NULL
value of Type.Code.STRUCT
. Such values are a tuple of named
and typed columns, where individual columns may be null. Individual rows from a read or query
operation can be considered as structs; ResultSet.getCurrentRowAsStruct()
allows an
immutable struct to be created from the row that the result set is currently positioned over.
Struct
instances are immutable.
This class does not support representing typed NULL
Struct
values.
However, struct values inside SQL queries are always typed and can be externally
supplied to a query only in the form of struct/array-of-struct query parameter values for which
typed NULL
struct values can be specified in the following ways:
1. As a standalone NULL
struct value or as a nested struct field value, constructed
using ValueBinder.to(Type, Struct)
or Value.struct(Type, Struct)
.
2. As as a null Struct
reference representing a NULL
struct typed element
value inside an array/list of 'Struct
' references, that is used to construct an
array-of-struct value using Value.structArray(Type, Iterable)
or ValueBinder.toStructArray(Type, Iterable)
. In this case, the type of the NULL
struct
value is assumed to be the same as the explicitly specified struct element type of the
array/list.
Modifier and Type | Class and Description |
---|---|
static class |
Struct.Builder
Builder for constructing non-
NULL Struct instances. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Struct |
getStruct(int columnIndex)
TODO(user) : Consider moving these methods to the StructReader interface once STRUCT-typed
columns are supported in
ResultSet . |
Struct |
getStruct(String columnName) |
protected abstract Struct |
getStructInternal(int columnIndex) |
int |
hashCode() |
static Struct.Builder |
newBuilder()
Returns a builder for creating a non-
NULL Struct instance. |
checkNonNull, getBigDecimal, getBigDecimal, getBigDecimalInternal, getBigDecimalList, getBigDecimalList, getBigDecimalListInternal, getBoolean, getBoolean, getBooleanArray, getBooleanArray, getBooleanArrayInternal, getBooleanInternal, getBooleanList, getBooleanList, getBooleanListInternal, getBytes, getBytes, getBytesInternal, getBytesList, getBytesList, getBytesListInternal, getColumnCount, getColumnIndex, getColumnType, getColumnType, getDate, getDate, getDateInternal, getDateList, getDateList, getDateListInternal, getDouble, getDouble, getDoubleArray, getDoubleArray, getDoubleArrayInternal, getDoubleInternal, getDoubleList, getDoubleList, getDoubleListInternal, getJson, getJson, getJsonInternal, getJsonList, getJsonList, getJsonListInternal, getLong, getLong, getLongArray, getLongArray, getLongArrayInternal, getLongInternal, getLongList, getLongList, getLongListInternal, getString, getString, getStringInternal, getStringList, getStringList, getStringListInternal, getStructList, getStructList, getStructListInternal, getTimestamp, getTimestamp, getTimestampInternal, getTimestampList, getTimestampList, getTimestampListInternal, getValue, getValue, getValueInternal, isNull
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getType, isNull
public static Struct.Builder newBuilder()
NULL
Struct
instance.public Struct getStruct(int columnIndex)
ResultSet
.protected abstract Struct getStructInternal(int columnIndex)
Copyright © 2022 Google LLC. All rights reserved.