Package datomic

Interface Attribute


public interface Attribute

Programmatic representation of a schema attribute.

Attribute information always resides in memory, so using this interface is more efficient than accessing the same information from the database via e.g. query.
Since:
0.9.4470
  • Field Details

    • CARDINALITY_MANY

      static final Object CARDINALITY_MANY
    • CARDINALITY_ONE

      static final Object CARDINALITY_ONE
    • UNIQUE_IDENTITY

      static final Object UNIQUE_IDENTITY
    • UNIQUE_VALUE

      static final Object UNIQUE_VALUE
    • TYPE_BIGDEC

      static final Object TYPE_BIGDEC
    • TYPE_BIGINT

      static final Object TYPE_BIGINT
    • TYPE_BOOLEAN

      static final Object TYPE_BOOLEAN
    • TYPE_BYTES

      static final Object TYPE_BYTES
    • TYPE_DOUBLE

      static final Object TYPE_DOUBLE
    • TYPE_FN

      static final Object TYPE_FN
    • TYPE_FLOAT

      static final Object TYPE_FLOAT
    • TYPE_INSTANT

      static final Object TYPE_INSTANT
    • TYPE_KEYWORD

      static final Object TYPE_KEYWORD
    • TYPE_LONG

      static final Object TYPE_LONG
    • TYPE_REF

      static final Object TYPE_REF
    • TYPE_STRING

      static final Object TYPE_STRING
    • TYPE_URI

      static final Object TYPE_URI
    • TYPE_UUID

      static final Object TYPE_UUID
  • Method Details

    • id

      Object id()
      The attribute's entity id
      Returns:
      an entity id
    • ident

      Object ident()
      The attribute's ident (programmatic name)
      Returns:
      an ident
    • valueType

      Object valueType()
      The attribute's value type
      Returns:
      a value type
    • cardinality

      Object cardinality()
      The attribute's cardinality
      Returns:
      either CARDINALITY_MANY or CARDINALITY_ONE
    • unique

      Object unique()
      Type of the attribute's unique index, if any.
      Returns:
      one of UNIQUE_IDENTITY, UNIQUE_VALUE, or null
    • isComponent

      boolean isComponent()
      Is this a component attribute?
      Returns:
      true if :db/isComponent true for this attribute
    • isIndexed

      boolean isIndexed()
      Is this attribute configured for an AVET index?
      Returns:
      true if :db/index true for this attribute, or attribute is unique
    • hasAVET

      boolean hasAVET()

      Does this attribute currently have an AVET index?

      When you alter an existing schema, indexes are created in the background after setting :db/index to true. This method returns true once a recently-added index is ready for use.
      Returns:
      true if AVET index available for this attribute
    • hasNoHistory

      boolean hasNoHistory()
      Is this a noHistory attribute?
      Returns:
      true if :db/noHistory true for this attribute
    • hasFulltext

      boolean hasFulltext()
      Does this attribute have a fulltext index?
      Returns:
      true if :db/fulltext true for this attribute