Annotation 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 ElementsModifier and TypeRequired ElementDescriptionClass<? extends BeforeFind<?, ?>> TheBeforeFindimplementation to invoke before the query.
-
Element Details
-
value
Class<? extends BeforeFind<?,?>> valueTheBeforeFindimplementation 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
-