Package jakarta.data.repository
Annotation Interface Param
Annotates a parameter of a repository method to bind it to a named parameter of a Query
.
For example,
@Repository public interface Products extends BasicRepository<Product, String> { @Query("WHERE length * width * height <= :maxVolume ORDER BY price ASC, id ASC") Page<Product> freeShippingEligible(@Param("maxVolume") float volumeLimit, PageRequest pageRequest); ... }
The Param
annotation is unnecessary when the method parameter name matches the query language
named parameter name and the application is compiled with the -parameters
compiler option making
parameter names available at runtime.
- See Also:
-
Required Element Summary
-
Element Details
-
value
String valueDefines the name of the query language named parameter to bind to.- Returns:
- the name of the query language named parameter.
-