I have an existing native named-query in .xml file, but my method name is according to pattern which Spring Data JPA can create a query for. So it ignores the named query regardless of the @Query(name="myQueryName") annotation, and creates the query according to method name.
By the way query is defined in hibernate .hbml.xml files and not in Spring properties file.
If I change method name (so Spring cannot create a query for), it executes my native query.
I have an existing native named-query in .xml file, but my method name is according to pattern which Spring Data JPA can create a query for. So it ignores the named query regardless of the
@Query(name="myQueryName")
annotation, and creates the query according to method name.By the way query is defined in hibernate .hbml.xml files and not in Spring properties file.
If I change method name (so Spring cannot create a query for), it executes my native query.