Annotation Type DataSubjectId


  • @Retention(RUNTIME)
    @Target({ANNOTATION_TYPE,FIELD})
    @Repeatable(DataSubjectIdContainer.class)
    public @interface DataSubjectId
    Field annotation that marks the field as containing an identifier of the key to be used when encrypting personal data fields of this class. It can also be used as a meta-annotation on some other application-specific annotation.

    Multiple annotations of this type may be present on the same field, but they should have different group attributes.

    For use in Scala programs, there is a dataSubjectId 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 field identifies the key for.
      String prefix
      Get the prefix used when constructing key ids from the field value.
      Scope scope
      Get the Scope of the annotation.
    • Element Detail

      • group

        String group
        Get the name of the group of personal data fields that field identifies the key for. This is useful if multiple keys are used on a single class. The group links key identifier to fields, since the PersonalData annotation has this same field. If multiple annotations of this type occur in the same class, all group attributes must be unique.

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

        Returns:
        the group
        Default:
        ""
      • prefix

        String prefix
        Get the prefix used when constructing key ids from the field value. The effective key id will be prefix + value.

        Optional. If left empty this defaults to the empty string.

        Returns:
        the prefix
        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.
        Returns:
        the scope
        Default:
        io.axoniq.dataprotection.api.Scope.DEFAULT