com.avaje.ebean.annotation.DbJsonB Maven / Gradle / Ivy
package com.avaje.ebean.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Specify a property holding JSON content.
*
* The content will be stored on Postgres using it's JSONB type and as Clob for other databases.
*
*
* This is equivalent to using @DbJson(storage = DbJsonType.JSONB)
*
*
* Example:
* {@code
*
* // Store as JSONB on Postgres or Clob on other databases
* @DbJsonB
* Map content;
*
* }
*
* Equivalent to:
* {@code
*
* // Store as JSONB on Postgres or Clob on other databases
* @DbJson(storage = DbJsonType.JSONB)
* Map content;
*
* }
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface DbJsonB {
/**
* For VARCHAR storage specify the column length.
*/
int length() default 0;
}