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.
Query
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the name of the query language named parameter.Defines the name of the query language named parameter to bind to. |
| value | back to summary |
|---|---|
| public String value() Defines the name of the query language named parameter to bind to.
| |