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

tech.ydb.yoj.databind.schema.TTL 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.schema;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Specifies TTL settings fot the annotated entity.
 *
 * 
 *      Example:
 *
 *      @TTL(field = "createdAt", interval = "PT12H")
 *      public class LogEntry { ... }
 * 
*/ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface TTL { /** * Field, which will be used to calculate if the row might be deleted * Accepted dbTypes of columns: *
    *
  • Date
  • *
  • Datetime
  • *
  • Timestamp
  • *
*/ String field(); /** * Interval in ISO 8601 format defining lifespan of the row */ String interval(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy