Annotation Interface Alias


@Documented @Target({FIELD,METHOD}) @Retention(RUNTIME) public @interface Alias
Annotation used on properties of an entity value that provide an alternative identifier to find the entity.

Finding an entity by alias is used both when looking for a child entity via Entity.getEntity(java.lang.Object), and when loading an entity (or aggregate) by entity id, e.g. using FluxCapacitor.loadAggregateFor(java.lang.Object, java.lang.Class<?>).

You can annotate fields and property methods. If a property value is a collection the members of the collection are all added as aliases of the entity. If the property value is null or an empty collection the alias is ignored.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Adds given string as a postfix to the alias (if the property value is non-null).
    Adds given string as a prefix to the alias (if the property value is non-null).
  • Element Details

    • prefix

      String prefix
      Adds given string as a prefix to the alias (if the property value is non-null). Useful to prevent clashes with other entity ids.
      Default:
      ""
    • postfix

      String postfix
      Adds given string as a postfix to the alias (if the property value is non-null). Useful to prevent clashes with other entity ids.
      Default:
      ""