Hql语句中可以实现批量删除或者查询的功能吗

在查询时,传入一个id的数组,然后提取这些id的对象,利用Hql语句可以实现吗?
我今天实验了一下,发现总不太对

	    String[] ids = {"4aec7b4a0e96cf8c010e96f35edd000b","4aec7b4a0e96cf8c010e96f5353b000e"};
	    
            String str="";
	    for(int i=0;i<ids.length;i++){
			str+="'"+ids[i]+"'";
			if(i!=(ids.length-1))
			    str+=",";
	    	}

	    List list;
	    try {
    		list = appinfoManager.find("from Appinfo where id in (?)",str);
    		System.out.println("共有"+list.size()+"条记录");
	    } catch (DaoException e) {
			e.printStackTrace();
	    }


查询结果为0条记录,但是数据库中确实存在这些记录。
其实这些在sql中应该可以实现的,不知道在hql语句中为什么不行

你可能感兴趣的:(sql,.net,Blog)