001package com.avaje.ebean.annotation;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007
008/**
009 * Specify a property holding JSON content.
010 * <p>
011 * The content will be stored on Postgres using it's JSONB type and as Clob for other databases.
012 * </p>
013 * <p>
014 *   This is equivalent to using <code>@DbJson(storage = DbJsonType.JSONB)</code>
015 * </p>
016 *
017 * <h3>Example:</h3>
018 * <pre>{@code
019 *
020 * // Store as JSONB on Postgres or Clob on other databases
021 * @DbJsonB
022 * Map<String,Object> content;
023 *
024 * }</pre>
025 *
026 * <h3>Equivalent to:</h3>
027 * <pre>{@code
028 *
029 * // Store as JSONB on Postgres or Clob on other databases
030 * @DbJson(storage = DbJsonType.JSONB)
031 * Map<String,Object> content;
032 *
033 * }</pre>
034 */
035@Retention(RetentionPolicy.RUNTIME)
036@Target(ElementType.FIELD)
037public @interface DbJsonB {
038
039  /**
040   * For VARCHAR storage specify the column length.
041   */
042  int length() default 0;
043}