我们可以在哪些条件下添加限制?
对于 HQL-1#
select activity from EmployeeActivity activity
join activity.activityStep as step
where
activity.currentStep = 1;
Criteria ctr = getSession().createCriteria(EmployeeActivity.class)
.createCriteria("activityStep")//Where activityStep is the another entity which is joined
.add(Restrictions.eq("currentStep", 1))
但是我应该如何为下面的 HQL 查询编写?而且,最佳做法是什么。
select activity from EmployeeActivity activity
join activity.activityStep as step
where
activity.currentStep = step.stepNumber;