1

I'm trying to add the Oracle Query Hint /*+ GATHER_PLAN_STATISTICS PARALLEL(16) */ to my Custom Query which looks similar to this:

@Query("SELECT " +
      " FROM myTable tab " +
      " WHERE tab.create_date >= to_date(:dateFrom) " +
      " AND tab.create_date < to_date(:dateTo)")
List<MyModel> findEntriesByDate( @Param("dateFrom") String dateFrom, @Param("dateTo") String dateTo);

I cannot find any way to make this work. I tried various things, for example adding this on top of the method:

@QueryHints({
            @QueryHint(name = org.hibernate.annotations.QueryHints.COMMENT, value = "GATHER_PLAN_STATISTICS")
    })

or

@QueryHints({
            @QueryHint(name = GATHER_PLAN_STATISTIC, value = "GATHER_PLAN_STATISTICS")
    })

Is there a way to make this work or do I have to change my approach?

EyedPeas
  • 146
  • 4
  • 17

0 Answers0