可以用循环拼接字符串和占位符插入进去
Object[] parameter = null;
????StringBuffer hql1=new StringBuffer();
????hql1.append("from BlogCategory ");
????if(CId!=null){
????????length=CId.size();
????????parameter=new Object[length];
????????for(int a=0;a
session.close();
return blogCategoryList;
string hql = "from smookindata where aid in ('"
for(int i=0;i<sids.length;i++){
hql += sids[i]+"',";
}
hql = hql.substring(0,hql.length()); //去掉最后一位(逗号)
hql += ")";
system.out.println(hql); //输出看看对不对
你是想批量操作吗?