String hql = " from JX_ExerciseDb where jdd like \'%"+jdd+"%\' and moduleid = \'"+trainid+"\' and type = 01";
Query qu = session.createQuery(hql);
List singlechoose = qu.list();
String hql = "select max(serial) from JX_ExerciseDb where type = " + type + " " +
"and jdd like \'" + jdd + "%"+isimport+"\' and moduleid = " + moduleid + " and usestate = 01 ";
"and jdd like \'" + jdd + "%"+isimport+"\' and moduleid = " + moduleid + " and usestate = 01 ";
在进行模糊查询时,QBC里用了"%"+jdd+"%",在最外面用了双引号;HQL里用了\'%"+jdd+"%\' ,在这里是使用的单引号。
在MYSQL中 使用like "%bin%"
在ORACLE中 使用like \'%bin%\'