Annotation Type PersonalData


  • @Retention(RUNTIME)
    @Target({ANNOTATION_TYPE,FIELD})
    @Repeatable(PersonalDataContainer.class)
    public @interface PersonalData
    Field annotation that marks the field as containing personal data. This triggers the Axon Data Protection Module to encrypt this fields when it processes an instance of the class declaring the field. The annotation can also be used as a meta-annotation on some other application-specific annotation.

    For use in Scala programs, there is a personalData type alias for this annotation, defined in the package object of the api package. This alias has the scala.annotation.meta.field meta-annotation which allows it to be directly used on Scala class parameters, including case classes.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String group
      Get the name of the group of personal data fields that this field belong to.
      boolean reencrypt
      Determines whether we should perform encryption if a field is already encrypted.
      String replacement
      Defines a string to be used by the ReplacementValueProvider to determine the behaviour in case the decryption key is unavailable.
      Scope scope
      Get the Scope of the annotation.
    • Element Detail

      • group

        String group
        Get the name of the group of personal data fields that this field belong to. This is useful if multiple keys are used on a single class. The group links the field to a particular key, since the DataSubjectId annotation has this same field.

        Optional. If left empty this defaults to the default group, identified by the empty string.

        Returns:
        the group
        Default:
        ""
      • scope

        Scope scope
        Get the Scope of the annotation. For non-Map fields, this should always be DEFAULT, whereas for Map fields it should always be KEY, VALUE, or BOTH.
        Returns:
        the scope
        Default:
        io.axoniq.dataprotection.api.Scope.DEFAULT
      • replacement

        String replacement
        Defines a string to be used by the ReplacementValueProvider to determine the behaviour in case the decryption key is unavailable. By default, the value of this annotation will be used in literal form for String fields and will be ignored for byte[], but custom implementations of ReplacementValueProvider may do otherwise.
        Returns:
        the replacement
        Default:
        ""
      • reencrypt

        boolean reencrypt
        Determines whether we should perform encryption if a field is already encrypted. By default this is false, resulting in idempotent behaviour of the FieldEncrypter.encrypt(Object) method. In some cases, it is desirable to make this true to deliberately perform 'double-encryption'.
        Returns:
        the reencrypt value
        Default:
        false