Hibernate模糊查询怎么做??
我要进行Hibernate的模糊查询,不知道该怎么写``
请高手指点
DetachedCriteria criteria = DetachedCriteria.forClass(FoodCategory.class);
criteria.add(Property.forName("name").like(foodCategoryName,?????));
请问"?????"该怎么写???
搜索更多相关主题的帖子:
Hibernate 模糊 criteria name 查询
----------------解决方案--------------------------------------------------------
呵呵.....
我也不会!这是我们这做的!你看行不?
String key1 = "'%" + key + "%'";
String wherecondition = ""; //sql语句中where条件
wherecondition = "haschild = 0 and deleted= 0 and ( kindname like " + key1 + " or shuoming like " + key1 + ")";
----------------解决方案--------------------------------------------------------