How to pass value for @Query annotation from application.yml file on Repository Interface method?

483 Views Asked by At

I want to pass dynamic native queries based on my database specific profile. So how to read value from application.yml file for the @Query annotation?

public EmployeeRepo extends CRUDRepository<Employee, Integer>{

@Query("${my-query}")
List<Employee> findBy();

}


application.yml:
my-query: Some-query

.

0

There are 0 best solutions below