Package com.google.spanner.v1
Enum TypeAnnotationCode
- All Implemented Interfaces:
com.google.protobuf.Internal.EnumLite,com.google.protobuf.ProtocolMessageEnum,Serializable,Comparable<TypeAnnotationCode>
public enum TypeAnnotationCode
extends Enum<TypeAnnotationCode>
implements com.google.protobuf.ProtocolMessageEnum
`TypeAnnotationCode` is used as a part of [Type][google.spanner.v1.Type] to disambiguate SQL types that should be used for a given Cloud Spanner value. Disambiguation is needed because the same Cloud Spanner type can be mapped to different SQL types depending on SQL dialect. TypeAnnotationCode doesn't affect the way value is serialized.Protobuf enum
google.spanner.v1.TypeAnnotationCode-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionPostgreSQL compatible JSONB type.PostgreSQL compatible NUMERIC type.PostgreSQL compatible OID type.Not specified. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intPostgreSQL compatible JSONB type.static final intPostgreSQL compatible NUMERIC type.static final intPostgreSQL compatible OID type.static final intNot specified. -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeAnnotationCodeforNumber(int value) static final com.google.protobuf.Descriptors.EnumDescriptorfinal com.google.protobuf.Descriptors.EnumDescriptorfinal intfinal com.google.protobuf.Descriptors.EnumValueDescriptorstatic com.google.protobuf.Internal.EnumLiteMap<TypeAnnotationCode>static TypeAnnotationCodevalueOf(int value) Deprecated.static TypeAnnotationCodevalueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) Returns the enum constant of this type with the specified name.static TypeAnnotationCodeReturns the enum constant of this type with the specified name.static TypeAnnotationCode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
TYPE_ANNOTATION_CODE_UNSPECIFIED
Not specified.
TYPE_ANNOTATION_CODE_UNSPECIFIED = 0; -
PG_NUMERIC
PostgreSQL compatible NUMERIC type. This annotation needs to be applied to [Type][google.spanner.v1.Type] instances having [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] type code to specify that values of this type should be treated as PostgreSQL NUMERIC values. Currently this annotation is always needed for [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] when a client interacts with PostgreSQL-enabled Spanner databases.
PG_NUMERIC = 2; -
PG_JSONB
PostgreSQL compatible JSONB type. This annotation needs to be applied to [Type][google.spanner.v1.Type] instances having [JSON][google.spanner.v1.TypeCode.JSON] type code to specify that values of this type should be treated as PostgreSQL JSONB values. Currently this annotation is always needed for [JSON][google.spanner.v1.TypeCode.JSON] when a client interacts with PostgreSQL-enabled Spanner databases.
PG_JSONB = 3; -
PG_OID
PostgreSQL compatible OID type. This annotation can be used by a client interacting with PostgreSQL-enabled Spanner database to specify that a value should be treated using the semantics of the OID type.
PG_OID = 4; -
UNRECOGNIZED
-
-
Field Details
-
TYPE_ANNOTATION_CODE_UNSPECIFIED_VALUE
public static final int TYPE_ANNOTATION_CODE_UNSPECIFIED_VALUENot specified.
TYPE_ANNOTATION_CODE_UNSPECIFIED = 0;- See Also:
-
PG_NUMERIC_VALUE
public static final int PG_NUMERIC_VALUEPostgreSQL compatible NUMERIC type. This annotation needs to be applied to [Type][google.spanner.v1.Type] instances having [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] type code to specify that values of this type should be treated as PostgreSQL NUMERIC values. Currently this annotation is always needed for [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] when a client interacts with PostgreSQL-enabled Spanner databases.
PG_NUMERIC = 2;- See Also:
-
PG_JSONB_VALUE
public static final int PG_JSONB_VALUEPostgreSQL compatible JSONB type. This annotation needs to be applied to [Type][google.spanner.v1.Type] instances having [JSON][google.spanner.v1.TypeCode.JSON] type code to specify that values of this type should be treated as PostgreSQL JSONB values. Currently this annotation is always needed for [JSON][google.spanner.v1.TypeCode.JSON] when a client interacts with PostgreSQL-enabled Spanner databases.
PG_JSONB = 3;- See Also:
-
PG_OID_VALUE
public static final int PG_OID_VALUEPostgreSQL compatible OID type. This annotation can be used by a client interacting with PostgreSQL-enabled Spanner database to specify that a value should be treated using the semantics of the OID type.
PG_OID = 4;- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getNumber
public final int getNumber()- Specified by:
getNumberin interfacecom.google.protobuf.Internal.EnumLite- Specified by:
getNumberin interfacecom.google.protobuf.ProtocolMessageEnum
-
valueOf
Deprecated.Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
value- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
forNumber
- Parameters:
value- The numeric wire value of the corresponding enum entry.- Returns:
- The enum associated with the given numeric wire value.
-
internalGetValueMap
-
getValueDescriptor
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()- Specified by:
getValueDescriptorin interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptorForType
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptor
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() -
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
desc- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-