Kumar
Kumar

Reputation: 11

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

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

.

Upvotes: 0

Views: 662

Answers (0)

Related Questions