Annotation Type TypeRole


  • @Retention(RUNTIME)
    @Target({METHOD,FIELD,ANNOTATION_TYPE})
    @Documented
    @Inherited
    public @interface TypeRole
    A type role indicates a method element in a repository that plays a role in query execution and should not be factored into query calculation but instead made available at runtime using the specified role name.

    This is used for example to configure a Pageable object to be handled differently to other query arguments.

    The parameter names of each role can be resolved from the MethodInvocationContext as a member of the DataMethod annotation where the member name is the role name.

    Since:
    1.0.0
    • Field Summary

      Fields 
      Modifier and Type Fields Description
      static java.lang.String ENTITIES
      The parameter that defines an iterable of the entity instances.
      static java.lang.String ENTITY
      The parameter that defines an instance of the entity.
      static java.lang.String ID
      The parameter that is used for the ID of entity.
      static java.lang.String LAST_UPDATED_PROPERTY
      Deprecated.
      static java.lang.String PAGE
      The parameter that is used to represent a Page.
      static java.lang.String PAGEABLE
      The parameter that is used for pagination.
      static java.lang.String SLICE
      The parameter that is used to represent a Slice.
      static java.lang.String SORT
      The parameter that is used for sorting.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String role
      The name of the role.
      java.lang.Class<?> type
      The parameter type.
    • Field Detail

      • PAGEABLE

        static final java.lang.String PAGEABLE
        The parameter that is used for pagination.
      • SORT

        static final java.lang.String SORT
        The parameter that is used for sorting.
      • ID

        static final java.lang.String ID
        The parameter that is used for the ID of entity.
      • ENTITY

        static final java.lang.String ENTITY
        The parameter that defines an instance of the entity.
      • ENTITIES

        static final java.lang.String ENTITIES
        The parameter that defines an iterable of the entity instances.
      • LAST_UPDATED_PROPERTY

        @Deprecated
        static final java.lang.String LAST_UPDATED_PROPERTY
        Deprecated.
        The last updated property of the entity for an update operation.
      • SLICE

        static final java.lang.String SLICE
        The parameter that is used to represent a Slice.
      • PAGE

        static final java.lang.String PAGE
        The parameter that is used to represent a Page.
    • Element Detail

      • role

        java.lang.String role
        The name of the role.
        Returns:
        The role name
      • type

        java.lang.Class<?> type
        The parameter type.
        Returns:
        The parameter type