List<Candidate> candidates = (List<Candidate>) session.createSQLQuery("select candidate.* from candidate inner join candidate_skill on candidate.id = candidate_skill.candidate_id inner join skill on candidate_skill.skill_id = skill.id where skill.id = 1");
我看到了:
java.lang.ClassCastException: org.hibernate.internal.SQLQueryImpl cannot be cast to java.util.List
查询是正确的。如何解决?