Annotation Overview

Elide exposes data models using a set of annotations. To describe relational modeling, we rely on the well-adopted JPA annotations. For exposition and security, we rely on custom Elide annotations. A comprehensive list of supported Elide annotations is below.

Core Annotations

Aggregation Annotations

Annotation Details

@ApiVersion

  • Description
    Binds a set of Elide models to a specific API Version.
  • Application Level
    • Package
  • Parameters
    • version
      • Description: The API Version name.
      • Type: String
      • Required: true
      • Default Value: None

@Audit

  • Description
    Enables audit logging for a particular package, class, method, or field whenever a specified action takes place via Elide. It takes advantage of Elide's Audit logging capabilities.
  • Application Level
    • Class
    • Field
    • Method
    • Package
  • Parameters
    • action
      • Description: The set of performed action(s) upon which audit should be triggered.
      • Type: Action[]
      • Required: false
      • Default Value: {Action.CREATE, Action.UPDATE, Action.DELETE}
    • logExpressions
      • Description: Unified expression language expressions that will be evaluated and substituted into the logging template.
      • Type: String[]
      • Required: false
      • Default Value: ""
    • logStatement
      • Description: Logging string template passed to audit logger for fired audit event.
      • Type: String
      • Required: false
      • Default Value: ""
    • operation
      • Description: Operation code to pass to audit logger for fired audit event.
      • Type: Integer
      • Required: false
      • Default Value: -1

@Audits

  • Description
    Enables a set of audit logging annotations to be applied to a particular package, class, method, or field whenever a specified action takes place through Elide.
  • Application Level
    • Class
    • Field
    • Method
    • Package
  • Parameters
    • value
      • Description: A set of @Audit annotations.
      • Type: Audit[]
      • Required: true
      • Default Value: None

@ComputedAttribute

  • Description
    Marks a method or field as a computed attribute that should be exposed via Elide regardless of whether or not it is marked as Transient.
  • Application Level
    • Field
    • Method
  • Parameters
    • None

@ComputedRelationship

  • Description
    Marks a method or field as a computed relationship that should be exposed via Elide regardless of whether or not it is marked as Transient.
  • Application Level
    • Field
    • Method
  • Parameters
    • None

@CreatePermission

  • Description
    Define security rules for creating an object through Elide. See the security section for more information.
  • Application Level
    • Class
    • Field
    • Method
    • Package
  • Parameters
    • expression
      • Description: A security expression parsed by Elide security. See the security section for more information.
      • Type: String
      • Required: true
      • Default Value: None

@DeletePermission

  • Description
    Define security rules for deleting an object through Elide. See the security section for more information.
  • Application Level
    • Class
    • Field
    • Method
    • Package
  • Parameters
    • expression
      • Description: A security expression parsed by Elide security. See the security section for more information.
      • Type: String
      • Required: true
      • Default Value: None

@ElideTypeConverter

  • Description
    Automatically registers the decorated Serde class with Elide.
  • Application Level
    • Class
  • Parameters
    • description
      • Description: The description of the serialized type exposed in the GraphQL schema.
      • Type: String
      • Required: false
      • Default Value: Custom Elide type
    • name
      • Description: The name of the serialized type exposed in the GraphQL schema.
      • Type: String
      • Required: true
      • Default Value: None
    • subTypes
      • Description: Subclasses of type that will also be handled by the registered Serde.
      • Type: Class []
      • Required: false
      • Default Value: {}
    • type
      • Description: The type that will be serialized & deserialized.
      • Type: Class
      • Required: true
      • Default Value: None

@Exclude

  • Description
    Marks that a given field or entity should not be exposed through Elide.
  • Application Level
    • Class
    • Field
    • Method
    • Package
  • Parameters
    • None

@Include

  • Description
    Marks that a given entity should be exposed through Elide.
  • Application Level
    • Class
    • Package
  • Parameters
    • description
      • Description: Model description that will be exported in Swagger (JSON-API) or the GraphQL schema.
      • Type: String
      • Required: false
      • Default Value: None
    • rootLevel
      • Description: Whether or not the entity is accessible as a "rootable" entity. Namely, if this collection of objects can be queried directly or whether or not it must be queried through a relationship.
      • Type: Boolean
      • Required: false
      • Default Value: true
    • type
      • Description: The API-exposed name for a particular entity type.
      • Type: String
      • Required: false
      • Default Value: Camel-cased name of the entity class

@LifeCycleHookBinding

  • Description
    Registers a function that will be invoked when a model is read or manipulated by Elide.
  • Application Level
    • Class
    • Field
    • Method
  • Parameters
    • hook
      • Description: The life cycle function to invoke.
      • Type: Class<? extends LifeCycleHook>
      • Required: true
      • Default Value: None
    • oncePerRequest
      • Description: For class level triggers, whether or not the hook should be called for each impacted field or exactly once for the class.
      • Type: Boolean
      • Required: false
      • Default Value: true
    • operation
      • Description: The operation that triggers the hook - CREATE, READ, UPDATE, or DELETE.
      • Type: Operation
      • Required: true
      • Default Value: None
    • phase
      • Description: When to invoke the hook (PRESECURITY, PRECOMMIT, or POSTCOMMIT).
      • Type: TransactionPhase
      • Required: true
      • Default Value: TransactionPhase.PRECOMMIT

@NonTransferable

  • Description
    Marks that a model cannot be assigned to another collection after its creation.
  • Application Level
    • Class
    • Package
  • Parameters
    • enabled
      • Description: Explicitly marks the model as non-transferable or otherwise.
      • Type: Boolean
      • Required: false
      • Default Value: true

@Paginate

  • Description
    Apply specific pagination rules to a specific entity.
  • Application Level
    • Class
  • Parameters
    • countable
      • Description: Whether or not the API will respond to request for page totals of this entity type.
      • Type: Boolean
      • Required: false
      • Default Value: true
    • defaultLimit
      • Description: If the client does not specify a page size, this is the number of elements that will be returned.
      • Type: Integer
      • Required: false
      • Default Value: 500
    • maxLimit
      • Description: The maximum number of records a user can request at a given time for a particular entity.
      • Type: Integer
      • Required: false
      • Default Value: 10000

@ReadPermission

  • Description
    Define security rules for reading an object through Elide. See the security section for more information.
  • Application Level
    • Class
    • Field
    • Method
    • Package
  • Parameters
    • expression
      • Description: A security expression parsed by Elide security. See the security section for more information.
      • Type: String
      • Required: true
      • Default Value: None

@SecurityCheck

  • Description
    Binds a security Check class in Elide with its human readable description. Elide scans for these and binds them during startup.
  • Application Level
    • Class
  • Parameters
    • value
      • Description: The human readable string that is used in Permissions (e.g. - "User is Admin")
      • Type: String
      • Required: true
      • Default Value: None

@ToMany

  • Description
    Marks a method or field as a relationship (to many) that should be exposed via Elide Despite JPA bindings.
  • Application Level
    • Field
    • Method
  • Parameters
    • None

@ToOne

  • Description
    Marks a method or field as a relationship (to one) that should be exposed via Elide Despite JPA bindings.
  • Application Level
    • Field
    • Method
  • Parameters
    • None

@UpdatePermission

  • Description
    Define security rules for updating an object through Elide. See the security section for more information.
  • Application Level
    • Class
    • Field
    • Method
    • Package
  • Parameters
    • expression
      • Description: A security expression parsed by Elide security. See the security section for more information.
      • Type: String
      • Required: true
      • Default Value: None

@ColumnMeta

  • Description
    Metadata to export about a table column.
  • Application Level
    • Field
    • Method
  • Parameters
    • category
      • Description: The category of the column.
      • Type: String
      • Required: false
      • Default Value: None
    • description
      • Description: The description of the column.
      • Type: String
      • Required: false
      • Default Value: None
    • friendlyName
      • Description: The friendly name for this column to be displayed in the UI.
      • Type: String
      • Required: false
      • Default Value: Same As field name
    • size
      • Description: A hint about the dimension's cardinality (TINY, SMALL, MEDIUM, LARGE, HUGE or UNKNOWN).
      • Type: CardinalitySize
      • Required: false
      • Default Value: UNKNOWN
    • tableSource
      • Description: The table and column names where to find the values (tableName.columnName).
      • Type: String
      • Required: false
      • Default Value: None
    • tags
      • Description: list of free-form text labels for the column.
      • Type: String[]
      • Required: false
      • Default Value: None
    • values
      • Description: An optional enumerated list of dimension values for small cardinality dimensions.
      • Type: String[]
      • Required: false
      • Default Value: None

@DimensionFormula

  • Description
    Native SQL fragment that defines a dimension column.
  • Application Level
    • Field
    • Method
  • Parameters
    • value
      • Description: A templated (optional) native SQL fragment. Field references enclosed in `{{ }}` are substituted with the SQL fragments of other model fields.
      • Type: String
      • Required: true
      • Default Value: None

@FromSubquery

  • Description
    Aggregation store annotation which binds an Elide model to a native SQL query.
  • Application Level
    • Class
  • Parameters
    • dbConnectionName
      • Description: The name of the database connection source where the physical data resides.
      • Type: String
      • Required: false
      • Default Value: None
    • sql
      • Description: The native SQL query that defines this model.
      • Type: String
      • Required: true
      • Default Value: None

@FromTable

  • Description
    Aggregation store annotation which binds an Elide model to a physical database table.
  • Application Level
    • Class
  • Parameters
    • dbConnectionName
      • Description: The name of the database connection source where the physical data resides.
      • Type: String
      • Required: false
      • Default Value: None
    • name
      • Description: The name of the physical table which backs the Elide model.
      • Type: String
      • Required: true
      • Default Value: None

@Join

  • Description
    A templated SQL 'on' clause to join two tables. Annotates a model field reference to another table.
  • Application Level
    • Field
    • Method
  • Parameters
    • value
      • Description: A join constraint like '%from.col1 = %join.col2' where %from is the current model and %join is the model being joined.
      • Type: String
      • Required: true
      • Default Value: None

@MetricFormula

  • Description
    Native SQL fragment that defines a metric column.
  • Application Level
    • Field
    • Method
  • Parameters
    • value
      • Description: A templated (optional) native SQL fragment. Field references enclosed in `{{ }}` are substituted with the SQL fragments of other model fields.
      • Type: String
      • Required: true
      • Default Value: None

@TableMeta

  • Description
    Metadata to export about a table.
  • Application Level
    • Class
  • Parameters
    • category
      • Description: The category of the table.
      • Type: String
      • Required: false
      • Default Value: None
    • description
      • Description: The description of the table.
      • Type: String
      • Required: false
      • Default Value: None
    • filterTemplate
      • Description: An RSQL filter expression template that must directly match or be included in the client provided filter.
      • Type: String[]
      • Required: false
      • Default Value: None
    • friendlyName
      • Description: The friendly name for this table to be displayed in the UI.
      • Type: String
      • Required: false
      • Default Value: Same As table name
    • isFact
      • Description: Is the table a Fact table.
      • Type: Boolean
      • Required: false
      • Default Value: true
    • size
      • Description: A hint about the table's size (TINY, SMALL, MEDIUM, LARGE, HUGE or UNKNOWN).
      • Type: CardinalitySize
      • Required: false
      • Default Value: UNKNOWN
    • tags
      • Description: list of free-form text labels for the column.
      • Type: String[]
      • Required: false
      • Default Value: None

@Temporal

  • Description
    Marks the dimension as a _time_ dimension.
  • Application Level
    • Field
    • Method
  • Parameters
    • grains
      • Description: The time grains or periods associated with the time dimension.
      • Type: TimeGrainDefinition[]
      • Required: true
      • Default Value: None
    • timeZone
      • Description: The timezone associated with the time dimension.
      • Type: String
      • Required: false
      • Default Value: UTC

@TimeGrainDefinition

  • Description
    Defines a time grain.
  • Application Level
    • Temporal Annotation
  • Parameters
    • expression
      • Description: A templated native SQL fragment. The template variable '{{}}' in the expression will be replaced with the column formula at query time.
      • Type: String
      • Required: false
      • Default Value: None
    • grain
      • Description: The time grain or period (DAY, YEAR, etc).
      • Type: TimeGrain
      • Required: true
      • Default Value: Day

@VersionQuery

  • Description
    Specifies a SQL query for SQLQueryEngine to use for detecting data changes. This must be present for SQLQueryEngine to support caching an entity.
  • Application Level
    • Class
  • Parameters
    • sql
      • Description: SQL SELECT query that returns a string or integer value. The value must change whenever the corresponding database table changes.
      • Type: String
      • Required: true
      • Default Value: None