以hql舉列更多的查幫助
// 使用List為參數作為條件結果
List<Integer> lst = new ArrayList<Integer>();
lstadd();
lstadd();
lstadd();
String hql = from Students s where sSId in (:lst);
Query q = sessioncreateQuery(hql);
qsetParameterList(lstlst);
// 以一個實類作為參數條件
hql = from Students s where sclass=:class;
qsetEntity(classsessionget(Classclass));
// 根據給的參數匹配對應的類型Type hiberntae裡的類
hql = from Students s where sSId=? or sSName=?;
Query q = sessioncreateQuery(hql);
qsetParameters(new Object [] { update }new Type [] { new IntegerType()new StringType() });
From:http://tw.wingwit.com/Article/program/Java/ky/201311/29068.html