我用dwr调用一个业务类的方法,那个方法用Hibernate链接数据库的一张表,查出的数据,每条数据封装成一个实体,返回一个这些实体的list集合,而我在dwr测试页测试的时候返回两个null, 
我在dwr.xml里增加了<convert converter="bean  match="com.worker.entity.MyBean">标签,怎么还是返回null啊 
我能确定查数据是没出错的,因为表里就有两条数据,返回了两个null,我增加一条,就返回3个null了,但是为什么是null呢,我都用convert了,

解决方案 »

  1.   

    如果不是<convert converter="bean" match="com.worker.entity.MyBean"/>少个引号.
    看看你的回调函数有没有问题.
      

  2.   

    我知道是怎么回事了,在用hibernate反向生成实体类的时候,由于存在表与表之间的主外键关系,而生成了部分set类型的多对一属性 ,把这些属性删掉就行了
      

  3.   

    function fstockcode(code)
    {
    JTvmistock.getfstockcode(code,iterfstockcode);
    }

    function iterfstockcode(list)
    {
    if(list!=null && list.length > 0){
    var stockcode="";
    for(var i=0;i<list.length;i++){
    stockcode=list[i].fstockcode;
    }
    var sum=eval(stockcode.substr(10,11))+1;
    document.getElementById("vmi.fstockcode").value="VMI-"+document.getElementById("vmi.fcustcode").value+"-00"+sum;
    }else
    {
    document.getElementById("vmi.fstockcode").value="VMI-"+document.getElementById("vmi.fcustcode").value+"-001";
    }
    }