Package tech.ydb.yoj.databind.schema
Annotation Interface Column
Specifies the mapped column for a persistent field.
If no Column annotation is specified, the default values apply.
Usage Example:
// DB column will have name 'DESC' and DB-specific type 'UTF8' @Column(name = "DESC", dbType = DbType.UTF8) String description; // Subobject's serialized representation will be written to a single BIG_SUBOBJ column @Column(name = "BIG_SUBOBJ", flatten = false) BigSubobject subobj1; // The subobject will be recursively "flattened" into DB columns of primitive types (string, // number, boolean). Each column will have the "BIG_SUBOBJ_FLAT" prefix. // (flatten=true is default databinding behavior and is shown here for clarity.) @Column(name = "BIG_SUBOBJ_FLAT", flatten = true) BigSubobject subobj2;
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionSpecifies custom conversion logic for this column, if any.The type of the DB column.
Defaults to automatically inferred from the field type.Qualifier for refining type representation of the DB column.
Defaults to automatically inferred from the field type.booleanDetermines whether thecomposite fieldwill be flattened into primitive-typed DB columns (flatten=true); or represented as a single field holding some serialized representation of the field's value (flatten=false).
Defaults totrue(flatten composite fields).
Changing this parameter for a non-composite field has no effect.The name of the DB column.
Defaults to the field name.
-
Element Details
-
name
String nameThe name of the DB column.
Defaults to the field name.- Default:
- ""
-
dbType
DbType dbTypeThe type of the DB column.
Defaults to automatically inferred from the field type.- Default:
- DEFAULT
-
dbTypeQualifier
String dbTypeQualifierQualifier for refining type representation of the DB column.
Defaults to automatically inferred from the field type.- Default:
- ""
-
flatten
boolean flattenDetermines whether thecomposite fieldwill be flattened into primitive-typed DB columns (flatten=true); or represented as a single field holding some serialized representation of the field's value (flatten=false).
Defaults totrue(flatten composite fields).
Changing this parameter for a non-composite field has no effect.- Default:
- true
-
customValueType
CustomValueType customValueTypeSpecifies custom conversion logic for this column, if any.- See Also:
- Default:
- @tech.ydb.yoj.databind.CustomValueType(columnValueType=UNKNOWN, columnClass=java.lang.Comparable.class, converter=tech.ydb.yoj.databind.converter.ValueConverter.NoConverter.class)
-