Annotation Interface JsonView


The annotation defining Json Duality View. Currently supported only by Oracle database.

@JsonView(value = "CONTACT_VIEW", alias = "cv", entity = Contact.class)
public class ContactView {
    {@literal @Id}
    {@literal @GeneratedValue(GeneratedValue.Type.IDENTITY)}
    private Long id;
    private String name;
    private int age;
    private LocalDateTime startDateTime;
    private boolean active;
}

Since:
4.0.0
Author:
radovanradic
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The possible sql operations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
    The name of the single column in the view.
    The entity class.
    boolean
    Whether the columns of the table contribute to the ETAG of the document.
    Properties of the entity() to expose as hidden fields.
    The supported sql operations array.
    Only applies to supported databases.
    The Json View name in the database.
    A SQL condition that restricts the rows of the root table exposed by the view, for example @.country = 'US'.
  • Field Details

  • Element Details

    • entity

      Class<?> entity
      The entity class. Specify an entity class annotated with MappedEntity that this JSON view corresponds to. Valid entity class is one that defines the properties used in this class.
      Returns:
      the entity class, defaults to void
      Default:
      void.class
    • operations

      JsonView.Operation[] operations
      The supported sql operations array.
      Returns:
      the supported operations array (default [UPDATE, INSERT, DELETE])
      Default:
      {INSERT, UPDATE, DELETE}
    • column

      @AliasFor(annotation=EntityRepresentation.class, member="column") String column
      The name of the single column in the view.
      Returns:
      the column name (default DATA)
      Default:
      "DATA"
    • value

      @AliasFor(annotation=MappedEntity.class, member="value") String value
      The Json View name in the database.
      Returns:
      the json view
      Default:
      ""
    • schema

      @AliasFor(annotation=MappedEntity.class, member="schema") String schema
      Only applies to supported databases.
      Returns:
      the schema to use for the query
      Default:
      ""
    • alias

      @AliasFor(annotation=MappedEntity.class, member="alias") String alias
      Returns:
      The view alias to use for the query
      Default:
      ""
    • where

      String where
      A SQL condition that restricts the rows of the root table exposed by the view, for example @.country = 'US'. Use the @. prefix to refer to columns of the table, it is replaced with the table alias. The view is generated WITH CHECK OPTION, so inserting or updating a document that does not satisfy the condition fails.
      Returns:
      the SQL condition
      Since:
      5.3
      Default:
      ""
    • hidden

      String[] hidden
      Properties of the entity() to expose as hidden fields. Hidden fields are not part of the document but can be referenced by generated fields, see JsonViewGenerated. Updating the document through the view keeps the values of hidden columns.
      Returns:
      the entity property names to expose as hidden fields
      Since:
      5.3
      Default:
      {}
    • etagCheck

      boolean etagCheck
      Whether the columns of the table contribute to the ETAG of the document. When false the table is generated with the NOCHECK annotation.
      Returns:
      true if the table is part of the ETAG check (default true)
      Since:
      5.3
      Default:
      true