springside api
SimpleHibernateDao.java类
2012-1-10
1.增加了1个and条件的EQS判断
/**
* 按属性查找对象列表, 同时满足pro1和pro2的条件.
*/
public List<T> findByPor1_Pro2(final String propertyName1,
final Object value1,final String propertyName2, final Object value2) {
Assert.hasText(propertyName1, "propertyName1不能为空");
Assert.hasText(propertyName2, "propertyName2不能为空");
Criterion criterion1 = Restrictions.eq(propertyName1, value1);
Criterion criterion2 = Restrictions.eq(propertyName2, value2);
return find(criterion1,criterion2);
}
posted on 2012-01-10 22:31 阳光总在风雨后001 阅读(380) 评论(0) 编辑 收藏 举报