Код: Выделить всё
String useIndexPrimary = "USE INDEX (PRIMARY)";
TypedQuery query = getEntityManager().createQuery("select d from "+getEntityName()+" d " + useIndexPrimary + " WHERE d.id in :defectIds", Defect.class);
query.setParameter("defectIds", ids);
Код: Выделить всё
SELECT d FROM DefectConcrete d USE INDEX(PRIMARY) WHERE d.id IN defects"
Код: Выделить всё
2024-07-22 12:01:27,936 [pool-177-thread-2] ::: ERROR com.optimyth.csaas.infrastructure.queues.spring.AnalysisLifeCycleManager -
java.lang.RuntimeException: Could not process stream for Diff defect.
...
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: USE near line 1, column 77 [select d from com.optimyth.csaas.metamodel.implementations.DefectConcrete d USE INDEX (PRIMARY) WHERE d.id in :defectIds]
Подробнее здесь: https://stackoverflow.com/questions/787 ... -token-use