【发布时间】:2014-03-20 12:03:45
【问题描述】:
我想根据student_id获取college_id,其中College包含Set<Student> students.
我正在查询
@Query("SELECT clg.id FROM College clg WHERE clg.students.any() = (:student)")
public List<Object> getCollegeIdByStudent(@Param("student") Student student);
传入的student 实例只包含主键。
抛出的异常是
org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet.
请提出正确的查询。
【问题讨论】:
标签: querydsl