我是用s1sh
private Integer id;//标识列
private Customer customer;//用户
private Wjj2 wjj;//
private String text;
private Set children = new HashSet(0);
private Set wjs = new HashSet(0);
private boolean leaf;
private int ord;
下面是getter,setter方法就不写出来了
这是dao类里的方法,获取list集合
public List<Wjj2> searchOnly(int id){
session=factory.openSession();
transaction=session.beginTransaction();
query=session.createSQLQuery("{call gui(?)}");
query.setInteger(0, id);
query.executeUpdate();
transaction.commit();
String hql="from Wjj2 w where w.wjj is null order by ord";

query=session.createQuery(hql);
List<Wjj2> wjjs=query.list();
session.close();
return wjjs;
}
这是我action中的方法
public ActionForward only(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response){
int id=Integer.parseInt(request.getParameter("id"));
List<Wjj2> wjjs=wjjDao.searchOnly(id);
JsonConfig jc=new JsonConfig();
jc.setExcludes(new String[]{"wjs","customer","wjj"});
JSONArray ja=JSONArray.fromObject(wjjs,jc);
try{
PrintWriter out=response.getWriter();
out.print(ja.toString());
out.close();
}catch(Exception e){
e.printStackTrace();
}
问题是Wjj2 有个set集合 每次用JsonArray转换 里面的顺序总是变,在页面ExtJs写的Tree的节点名也跟着变。
我想让tree的节点显示的固定下来,不管怎么刷新。