Can we pass or input a .sql file to the Query annotation in Spring JPA?
Something like this @Query(file:/sql/employeeList.sql , nativeQuery=true)
/sql/employeeList.sql - i would like to put this file somewhere in the code, which will have the select sql in it.
I am not looking to have native sql string @Query("select abc....", nativeQuery=true) -- I dont want to use like this. because my sql is too huge.
@Queryannotation but you can check this repo. You can just create your own JpaQueryMethodFactory that provides your own version ofJpaQueryMethod.