Oracle Parallel Hint on Spring Data JPA Specification

Viewed 712

Is it possible to use parallel hint on the spring data jpa specification? org.hibernate.jpa.QueryHints package does not contain PARALLEL hint.

I added a comment like in the example below. But I couldn't see the running query.

Calling find method with specifications:

CarSpecifications carSpecifications = new CarSpecifications(car);
List<Car> carList = carRepository.findAll(carSpecifications, pageable);

Repository:

@Override
public Page<T> findAll(Specification<T> spec, Pageable pageable) {

    TypedQuery<T> query = getQuery(spec, pageable);
    query.setHint("org.hibernate.comment", "Example Comment");
    return pageable == null ? new PageImpl<T>(query.getResultList()) : readPage(query, pageable, spec);
}

or in the interface

@QueryHints({ @QueryHint(name = "org.hibernate.comment", value ="Example Comment") })
Page<T> findAll(Specification<T> spec, Pageable pageable); 

Thanks.

0 Answers
Related