public List findByProperty(String comId, String property, Object value) {
String sql = "from " + clazz.getName() + " where comId=? and "
+ property + "=?";
return createQuery(sql, comId, value).list();
}
我想用面向对象查询,改如何操作呢
用Criteria cta=session.createCriteria(对象名);
cta.set几个criteria的属性
String hql="from 类名 类别名 where 类别名.字段=:参数名"