我在贾瓦、答复和合伙人中有两门POJO课程,关系很多。
class Answer {
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "ANSWERS_COLLABORATORS", joinColumns = { @JoinColumn(name = "aid") }, inverseJoinColumns = { @JoinColumn(name = "cid") })
private Set<Collaborator> collaborators = new HashSet<Collaborator>(0);
}
Class Answer
has a set of Collaborator
, but a Collaborator
doesn t keep a set of Answer
.
What I need to do from Hibernate CriteriaQuery
is to find the collaborators for an answer given by id.
我已经通过Hibernate Criteria
(org.hibernate.Criteria
,使用结果变压器,但我在使用Criteria Query
时 st了,因为我没有一份加入名单。