Annotation Interface ApiBeforeFind


@Retention(RUNTIME) @Target(METHOD) public @interface ApiBeforeFind
Registers a BeforeFind hook to be invoked before the query is executed by the proxy-api-controller interceptor.

Place this annotation on a method of an ApiFindController interface. The framework instantiates (or retrieves from the Spring context) the specified BeforeFind implementation and calls it with the current query parameter before delegating to JpaService.

Typical use cases: input enrichment, security checks, audit logging.

Example


 @ApiFindController
 public interface OrderController {

     @PostMapping("/orders/search")
     @ApiBeforeFind(TenantInjector.class)   // injects tenant context before querying
     List<OrderDto> search(@RequestBody OrderFilter filter);
 }
 
Author:
Francesco Baldi
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<? extends BeforeFind<?,?>>
    The BeforeFind implementation to invoke before the query.
  • Element Details

    • value

      Class<? extends BeforeFind<?,?>> value
      The BeforeFind implementation to invoke before the query. The class must be a valid Spring bean or have a no-arg constructor.
      Returns:
      the before-find hook class; must not be null