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.

@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
    • 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: false
    • type
      • Description: The API-exposed name for a particular entity type.
      • Type: String
      • Required: false
      • Default Value: Camel-cased name of the entity class

@OnCreatePostCommit

  • Description
    A lifecycle hook that executes on a create action after the transaction has committed successfully.
  • Application Level
    • Method
  • Parameters
    • value
      • Description: Field name on which the annotated method is only triggered if that field is modified. If value is empty string, then trigger once when the object is created. If value is "*", then this method will be triggered once for each field that the user sent in the creation request.
      • Type: String
      • Required: false
      • Default Value: Empty String

@OnCreatePreCommit

  • Description
    A lifecycle hook that executes on a create action after security has run, but before the transaction has committed.
  • Application Level
    • Method
  • Parameters
    • value
      • Description: Field name on which the annotated method is only triggered if that field is modified. If value is empty string, then trigger once when the object is created. If value is "*", then this method will be triggered once for each field that the user sent in the creation request.
      • Type: String
      • Required: false
      • Default Value: Empty String

@OnCreatePreSecurity

  • Description
    A lifecycle hook that executes on a create action before the security checks have run.
  • Application Level
    • Method
  • Parameters
    • value
      • Description: Field name on which the annotated method is only triggered if that field is modified. If value is empty string, then trigger once when the object is created. If value is "*", then this method will be triggered once for each field that the user sent in the creation request.
      • Type: String
      • Required: false
      • Default Value: Empty String

@OnDeletePostCommit

  • Description
    A lifecycle hook that executes on a delete action after the transaction has committed successfully.
  • Application Level
    • Method
  • Parameters
    • None

@OnDeletePreCommit

  • Description
    A lifecycle hook that executes on a delete action after security has run, but before the transaction has committed.
  • Application Level
    • Method
  • Parameters
    • None

@OnDeletePreSecurity

  • Description
    A lifecycle hook that executes on a delete action before the security checks have run.
  • Application Level
    • Method
  • Parameters
    • None

@OnReadPostCommit

  • Description
    A lifecycle hook that executes on a read action after the transaction has committed successfully.
  • Application Level
    • Method
  • Parameters
    • value
      • Description: Field name on which the annotated method is only triggered if that field is read. If value is empty string, then trigger once when the object is read. If value is "*", then trigger for all field reads.
      • Type: String
      • Required: false
      • Default Value: Empty String

@OnReadPreCommit

  • Description
    A lifecycle hook that executes on a read action after security has run, but before the transaction has committed.
  • Application Level
    • Method
  • Parameters
    • value
      • Description: Field name on which the annotated method is only triggered if that field is read. If value is empty string, then trigger once when the object is read. If value is "*", then trigger for all field reads.
      • Type: String
      • Required: false
      • Default Value: Empty String

@OnReadPreSecurity

  • Description
    A lifecycle hook that executes on a read action before the security checks have run.
  • Application Level
    • Method
  • Parameters
    • value
      • Description: Field name on which the annotated method is only triggered if that field is read. If value is empty string, then trigger once when the object is read. If value is "*", then trigger for all field reads.
      • Type: String
      • Required: false
      • Default Value: Empty String

@OnUpdatePostCommit

  • Description
    A lifecycle hook that executes on a update action after the transaction has committed successfully.
  • Application Level
    • Method
  • Parameters
    • value
      • Description: Field name on which the annotated method is only triggered if that field is modified. If value is empty string, then trigger once when the object is updated. If value is "*", then trigger for all field modifications.
      • Type: String
      • Required: false
      • Default Value: Empty String

@OnUpdatePreCommit

  • Description
    A lifecycle hook that executes on a update action after security has run, but before the transaction has committed.
  • Application Level
    • Method
  • Parameters
    • value
      • Description: Field name on which the annotated method is only triggered if that field is modified. If value is empty string, then trigger once when the object is updated. If value is "*", then trigger for all field modifications.
      • Type: String
      • Required: false
      • Default Value: Empty String

@OnUpdatePreSecurity

  • Description
    A lifecycle hook that executes on a update action before the security checks have run.
  • Application Level
    • Method
  • Parameters
    • value
      • Description: Field name on which the annotated method is only triggered if that field is modified. If value is empty string, then trigger once when the object is updated. If value is "*", then trigger for all field modifications.
      • Type: String
      • Required: false
      • Default Value: Empty String

@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

@SharePermission

  • Description
    Enable sharing permissions on an object through Elide. See the security section for more information.
  • Application Level
    • Class
    • Method
    • Package
  • Parameters
    • shareable
      • Description: Enable or disable shareability for an object. Shareable permissions are evaluated identically to an entity's read permissions. See the security section for more information.
      • Type: Boolean
      • Required: false
      • Default Value: true

@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