hibernate

hibernate 多个or写法
if(arr != null && arr.length > 0){
Criterion c = Restrictions.like("comment", arr[0], MatchMode.ANYWHERE);
for(int i=1; i< arr.length ; i++){
c = Restrictions.or(c,Restrictions.like("comment", arr[i], MatchMode.ANYWHERE));
}
}

你可能感兴趣的:(Hibernate)