@Query("select q from Question q where q.id in :questionIds") @QueryHints(value = { @QueryHint(name = org.eclipse.persistence.config.QueryHints.BATCH_TYPE, value = "IN"), @QueryHint(name = org.eclipse.persistence.config.QueryHints.BATCH, value = "q.questionOptions"), @QueryHint(name = org.eclipse.persistence.config.QueryHints.BATCH, value = "q.subquestions"), @QueryHint(name = org.eclipse.persistence.config.QueryHints.BATCH, value = "q.translations"), @QueryHint(name = org.eclipse.persistence.config.QueryHints.BATCH, value = "questionOptions.translations"), @QueryHint(name = org.eclipse.persistence.config.QueryHints.BATCH, value = "subquestions.translations"), @QueryHint(name = org.eclipse.persistence.config.QueryHints.BATCH, value = "subquestions.questionOptions"), }, forCounting = false) List<Question> findInList(@Param("questionIds") List<Integer> questionIds);
@QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") }) public List<Dictionary> findByType(int type);
@QueryHints(value = @QueryHint(name = HINT_FETCH_SIZE, value = "1")) @Query("SELECT r FROM RouteDataRevision r WHERE validFrom <= :date AND (validTo >= :date OR validTo IS NULL)") Stream<RouteDataRevision> findValid(@Param("date") Date date);
@QueryHints(value = { @QueryHint (name = "org.hibernate.cacheable", value = "true")}) List<Country> findByPopulationGreaterThan(Integer population);
@Query("from RunningExecutionPlan r where r.flowUUID = :flowUUID") @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") }) public List<RunningExecutionPlan> findByUuidCached(@Param("flowUUID") String flowUUID);
@QueryHints(value = { @QueryHint(name = "org.hibernate.readOnly", value = "true")}) Person findById(Long id);