I've seen posts saying that this isn't possible without a theta join, giving me back *far* more rows than necessary. Despite my own cynicism of Hibernate, it'd be too absurd for that to be the only answer.
But, I digress. Is there a proper way to do this:
Code:
List<Course> courses = em.createQuery("from Course2007 c " +
"join CourseMember mem " +
"where c.term=mem.term and c.identifier = mem.identifier " +
"and mem.pid=:pid and mem.role=:role")
.setParameter("role", CourseMember.ROLE_INSTRUCTOR)
.setParameter("pid", pid).getResultList();
There isn't any relationship defined for these two entities. There are good reasons for that.
Assuming that Hibernate has this basic functionality somewhere in here, how do I get to it?
Thanks in advance for any help?