Hibernate or method: logic or operation
•
Java
or(Criterion lhs,Criterion rhs)
Example
Criteria criteria = session.createCriteria(PersonForm.class); //定义Criteria对象 criteria.add(Restrictions.or(Restrictions.eq("kNowledge","大专"),Restrictions.gt("workAge",5))); //定义查询语句 list = criteria.list(); //执行查询语句返回list集合
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码