Can I pass a properties value inside @Query
annotation ?
My purpose is to pass native query as such to @Query
notation.
So, whenever a change is made, i need to update the properties file value only.
Say this getQuery method returns a properties file value;
@Repository
@Transactional
public interface HerRepository extends CrudRepository<Order, String> {
String queryVal= SqlQueries.getQuery("herself");
@Query(name = "herNameQuery", value = queryVal, nativeQuery = true)
List<Object[]> findHerName();
When i tried to use, I am getting this error like,
Value of an annotation Query.value must be a constant expression.