Annotation Interface CrudCrafted


@Target(TYPE) @Retention(SOURCE) public @interface CrudCrafted
Annotation to mark a class as a CrudCrafted entity. When applied, CrudCraft will generate a complete CRUD implementation for the entity.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    If set, all the generated code (dtos, repos, services, controllers, etc.) will be rooted at this package instead of the entity's own package.
    boolean
    When true, we generate a concrete stub extending the abstract base (once).
    Used for user-defined policies that can be used to control which endpoints are generated.
    Used for generating additional code.
    Used for omitting endpoints that are not needed, but are included in the specified template.
    boolean
    Toggle table/endpoint security.
    The table-level security policy to use for generating @PreAuthorize expressions.
    The CrudTemplate to use for generating endpoints.
  • Element Details

    • editable

      boolean editable
      When true, we generate a concrete stub extending the abstract base (once).
      Default:
      false
    • basePackage

      String basePackage
      If set, all the generated code (dtos, repos, services, controllers, etc.) will be rooted at this package instead of the entity's own package.
      Default:
      ""
    • template

      CrudTemplate template
      The CrudTemplate to use for generating endpoints. Defaults to FULL, which generates all CRUD operations.
      Default:
      FULL
    • omitEndpoints

      CrudEndpoint[] omitEndpoints
      Used for omitting endpoints that are not needed, but are included in the specified template.
      Default:
      {}
    • includeEndpoints

      CrudEndpoint[] includeEndpoints
      Used for generating additional code. This can be used to add endpoints that are not part of the specified template.
      Default:
      {}
    • endpointPolicy

      Class<? extends CrudEndpointPolicy> endpointPolicy
      Used for user-defined policies that can be used to control which endpoints are generated.
      Default:
      nl.datasteel.crudcraft.annotations.CrudTemplate.class
    • secure

      boolean secure
      Toggle table/endpoint security. When false, no @PreAuthorize wrappers are generated.
      Default:
      true
    • securityPolicy

      Class<? extends CrudSecurityPolicy> securityPolicy
      The table-level security policy to use for generating @PreAuthorize expressions.
      Default:
      nl.datasteel.crudcraft.annotations.security.policy.PermitAllSecurityPolicy.class