There seems to be a typo in the Spring Data JDBC section for @Query
since the following custom repository query with the placeholder reference :#{topic.id}
:
@Query("SELECT * FROM activity" +
" WHERE topic = :#{topic.id}" +
" AND lower(name) LIKE lower(:namePattern)" +
" ORDER BY name")
List<Activity> findAllNameLikeCaseInsensitive(Topic topic, String namePattern);