All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.ydb.yoj.databind.converter.StringColumn Maven / Gradle / Ivy

Go to download

Core data-binding logic used by YOJ (YDB ORM for Java) to convert between Java objects and database rows (or anything representable by a Java Map, really).

The newest version!
package tech.ydb.yoj.databind.converter;

import tech.ydb.yoj.databind.CustomValueType;
import tech.ydb.yoj.databind.schema.Column;

import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.RECORD_COMPONENT;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Annotation for fields that should be stored as text in the database.
 * 
    *
  • The conversion to text will be performed using {@link Object#toString()}.
  • *
  • The conversion from text to a Java value will be performed using one of * ({@code static fromString(String)}, {@code static valueOf(String)} or the 1-arg {@code String} constructor).
  • *
* * @see StringValueConverter */ @Inherited @Retention(RUNTIME) @Target({FIELD, RECORD_COMPONENT, ANNOTATION_TYPE}) @Column(customValueType = @CustomValueType(columnClass = String.class, converter = StringValueConverter.class)) public @interface StringColumn { }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy