我想知道是否有办法为休眠析取添加条件?
例子
Criterion creator;
if(securityService.hasRole(RoleConstants.ROLE_CREATOR) {
creator = Restrictions.conjunction()
.add(Restrictions.eq("creator", this.userInfo.getUser()))
.add(Restrictions.eq("currentState.id", DatabaseConstants.STATE_DRAFT));
}
Criterion completeCondition = Restrictions.disjunction().add(creator)
.add(authorizer)
.add(assessor);
谢谢