Annotation Interface Alias


@Documented @Target({FIELD,METHOD}) @Retention(RUNTIME) public @interface Alias
Marks a property whose current value is an alternative identifier for an entity or independently stored model.

Aliases are used when looking for an embedded entity via Entity.getEntity(Object), when resolving a legacy aggregate through Fluxzero.loadAggregateFor(Object, Class), and when loading an independent model through Fluxzero.loadModel(Object).

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.

On an independently stored Model, the complete current alias set is replaced atomically with each model transition. A changed or deleted alias therefore stops resolving after that commit. Such aliases identify a model globally and must be unique across independently stored models. A primary model ID takes precedence over an equal alias. Aliases which are intentionally local to one aggregate tree should not be exposed as independent-model aliases.

  • 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:
      ""