package io.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:
// Store as JSONB on Postgres or Clob on other databases
@DbJsonB Map content;
}
Equivalent to:
// Store as JSONB on Postgres or Clob on other databases
@DbJson(storage = DbJsonType.JSONB) Map content;
}
/**
* Specify a property holding JSON content.
* <p>
* The content will be stored on Postgres using it's JSONB type and as Clob for other databases.
* </p>
* <p>
* This is equivalent to using <code>@DbJson(storage = DbJsonType.JSONB)</code>
* </p>
* <p>
* <h3>Example:</h3>
* <pre>{@code
*
* // Store as JSONB on Postgres or Clob on other databases
* @DbJsonB
* Map<String,Object> content;
*
* }</pre>
* <p>
* <h3>Equivalent to:</h3>
* <pre>{@code
*
* // Store as JSONB on Postgres or Clob on other databases
* @DbJson(storage = DbJsonType.JSONB)
* Map<String,Object> content;
*
* }</pre>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface DbJsonB {
The name of the column (Optional).
/**
* The name of the column (Optional).
*/
String name() default "";
For VARCHAR storage specify the column length.
/**
* For VARCHAR storage specify the column length.
*/
int length() default 0;
}