Class StringValueConverter<J>

java.lang.Object
tech.ydb.yoj.databind.converter.StringValueConverter<J>
Type Parameters:
J - Java type
All Implemented Interfaces:
ValueConverter<J,String>

public final class StringValueConverter<J> extends Object implements ValueConverter<J,String>
Generic YDB text column ↔ Java value converter. Uses Object.toString() to convert Java values to YDB column values, and one of (static fromString(String), static valueOf(String) or the 1-arg String constructor) to convert YDB column values back to Java.
  • Apply it locally to your entity's field, by using the @StringColumn annotation. Explicitly specify @Column(customValueType=@CustomValueType(columnClass=String.class, converter=StringValueConverter.class), ...) if you need to add more column customizations.
  • Apply it globally to a user-defined field type, by using the @StringValueType annotation. Explicitly specify @CustomValueType(columnClass=String.class, converter=StringValueConverter.class), ...) if you prefer not to use meta-annotations.