String thirdid=dbo.nextID("7"); // thirdid为11,12,13,14,34,多了一个逗号,下面蓝色的部分是进行处理
String hqldown="from Source_inf where in ("+thirdid.substring(0,(thirdid.length()-1))+") order by neworders";
DBOperator的一个方法如下
/**
* 根据source_type的id判断是下级的id ,现在收录第三级的id
*
*/
public String nextID(String id)
{
String myid=id+",";
// Source_type
// hql="from Source_type where id="+level;
String hql="from Source_type where levels="+id;
// this.setLength(20);
List secondidL=this.findSQLHibernate(hql, 1);
Source_type mytype2=new Source_type();
Source_type mytype3=new Source_type();
for(int q=0;q<secondidL.size();q++)
{
mytype2=(Source_type)secondidL.get(q);
int thisid=mytype2.getId();
String hql2="from Source_type where levels="+thisid;
List thirdidL=this.findSQLHibernate(hql2, 1);
for(int a=0;a<thirdidL.size();a++)
{ mytype3=(Source_type)thirdidL.get(a);
int thirdid=mytype3.getId();
myid+=thirdid;
myid+=",";
}
}
return myid;
}