You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Query("select u from User u where u.firstname = :#{#customer.firstname}")
List<User> findUsersByCustomersFirstname(@Param("customer") Customercustomer);
I thought this feature is common to all spring data projects, but it seems to be specific to jpa.
The text was updated successfully, but these errors were encountered:
We now support SpEL expressions in string-based queries to bind parameters for more dynamic queries. SpEL expressions are enclosed in :#{…} and rendered as synthetic named parameter so their values are substituted with bound parameters to avoid SQL injection attach vectors.
interface PersonRepository extends Repository<Person, String> {
@query("SELECT * FROM person WHERE lastname = :#{'hello'}")
Mono<Person> findHello();
@query("SELECT * FROM person WHERE lastname = :#{[0]} and firstname = :firstname")
Mono<Person> findByLastnameAndFirstname(@param("value") String value, @param("firstname") String firstname);
@query("SELECT * FROM person WHERE lastname = :#{#person.name}")
Mono<Person> findByExample(@param("person") Person person);
}
Something like that https://spring.io/blog/2014/07/15/spel-support-in-spring-data-jpa-query-definitions:
I thought this feature is common to all spring data projects, but it seems to be specific to jpa.
The text was updated successfully, but these errors were encountered: