Class YqlPrimitiveType
- All Implemented Interfaces:
YqlType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDeprecated, for removal: This API element is subject to removal in a future version.This method will be removed in YOJ 3.0.0.fromYql(tech.ydb.proto.ValueProtos.Value value) tech.ydb.proto.ValueProtos.Type.Builderstatic @NonNull YqlPrimitiveTypeDeprecated, for removal: This API element is subject to removal in a future version.This method will be removed in YOJ 3.0.0.static @NonNull YqlPrimitiveTypeof(Schema.JavaField column) Returns the Yql type of the column.static voidDeprecated, for removal: This API element is subject to removal in a future version.This method has a misleading name and will be removed in YOJ 3.0.0.tech.ydb.proto.ValueProtos.Value.Builderstatic voiduseLegacyMappingFor(FieldValueType... fieldValueTypes) Deprecated.We STRONGLY advise against using the legacy mapping in new projects.static voiduseRecommendedMappingFor(FieldValueType... fieldValueTypes) Uses the recommended field value type ↔ YDB column type mapping for the specified field value type(s).
-
Constructor Details
-
YqlPrimitiveType
public YqlPrimitiveType()
-
-
Method Details
-
changeStringDefaultTypeToUtf8
Deprecated, for removal: This API element is subject to removal in a future version.This method will be removed in YOJ 3.0.0. CalluseNewMappingFor(STRING, ENUM, UUID)instead, if you wish to map Strings, Enums and UUIDs toUTF8(TEXT) YDB column type (i.e., UTF-8 encoded text). -
resetStringDefaultTypeToDefaults
Deprecated, for removal: This API element is subject to removal in a future version.This method has a misleading name and will be removed in YOJ 3.0.0. CalluseLegacyMappingFor(STRING, ENUM, UUID)instead, if you wish to map Strings, Enums and UUIDs toSTRING(BYTES) YDB column type (i.e., a byte array). -
useLegacyMappingFor
Deprecated.We STRONGLY advise against using the legacy mapping in new projects. Please calluseNewMappingFor(FieldValueType.values())instead, and annotate custom-mapped columns with@Columnwhere a different mapping is desired.Uses the legacy (YOJ 1.0.x) field value type ↔ YDB column type mapping for the specified field value type(s).If you need to support a wide range of legacy applications, call
useLegacyMappingFor(FieldValueType.values())before using any YOJ features.You can apply the legacy mapping partially, e.g.
useLegacyMappingFor(STRING, ENUM, UUID)to map String, Enums and UUIDs toSTRING(BYTES) YDB column type (i.e., a byte array).- Parameters:
fieldValueTypes- field value types to use legacy mapping for
-
useRecommendedMappingFor
Uses the recommended field value type ↔ YDB column type mapping for the specified field value type(s).In new projects, we STRONGLY advise you to call
useNewMappingFor(FieldValueType.values())before using any YOJ features. This will eventually become the default mapping, and this call will become a no-op and might even be removed in a future version of YOJ.You can apply the new mapping partially, e.g.
useNewMappingFor(STRING, ENUM, UUID)to map String, Enums and UUIDs toUTF8(TEXT) YDB column type (i.e., UTF-8 encoded text).- Parameters:
fieldValueTypes- field value types to use the new mapping for
-
of
Deprecated, for removal: This API element is subject to removal in a future version.This method will be removed in YOJ 3.0.0. Nothing in YOJ callsYqlPrimitiveType.of(Type)any more.Please use
YqlPrimitiveType.of(JavaField)because it correcly respects the customizations specified in the@Columnand@CustomValueTypeannotations. -
of
Returns the Yql type of the column.If the
Columnannotation is specified for thecolumnfield, the annotation fielddbTypemay be used to specify the column type.- Returns:
- the Yql type of the column
-
getYqlTypeName
- Specified by:
getYqlTypeNamein interfaceYqlType
-
getYqlTypeBuilder
public tech.ydb.proto.ValueProtos.Type.Builder getYqlTypeBuilder()- Specified by:
getYqlTypeBuilderin interfaceYqlType
-
toYql
-
fromYql
-