2

In a project, I need to specify oracle hint in query. Spring JPA gives us to ability defining hint in @QueryHint (javax.persistence) annotation for query definition. But when I set oracle hint, app throws Ignoring unrecognized query hint [hint-definition] while query executes.

I found some question and answer 10 years ago or earlier than. They told you should be use native query. But I aim that code should be clean as possible.

How can specify custom query hint with JPA (or any Spring and Hibernate) annototion based on query?

Note : In project, eclipselink is not used.

Thanks for your help.

picassoo
  • 21
  • 3
  • 1
    The query hint is for JPA/Hibernate NOT for the database. Are you execution native SQL? – Simon Martinelli Dec 27 '21 at 09:05
  • Yes, I already solved with native SQL. EclipseLink gives us these funcionality that manipulete SQL its own QueryHints annotation. But I try to solve in JPA/Hibernate QueryHint annotation. If there is no solution without native SQL, I publish app with native SQL solution. – picassoo Dec 28 '21 at 13:24

0 Answers0