如何实现HQL动态查询

2025-04-29 21:59:16
推荐回答(1个)
回答1:

首先用request.getParameter 得到前台的值
然后写到MAP里
public List findByMap(Map map){
id = map.get("id");//获取值
String hql = null;
hql = "select * from a where id = '"+id+"' ";
List list = getHibernateTemplate().find(hql);//HibernateHQL模板
return list;