我从数据查询数据,由于A表a字段 要换成B表的b字段数据,我从数据库查询出来后 保存在List<A>集合中,
结果我去访问List集合中的的数据的时候报错!! 大大们 求解救!!这个是我SQL语句的图片
这个是我取数据时的代码
这个是我报错的代码

解决方案 »

  1.   

    图片没发成 把代码copy上
    String hql="select sh.memberId as memberId,to_char(sh.chaDate,'yyyy-mm-dd') as chaDate,sh.orderId as orderId,sh.isGain as isGain,sh.chaScore as chaScore,sd.name as chaReason,sh.totalScore as totalScore "+
        " from ScoreHistory sh  left join sh.chaReasonDic sd "+
        " where to_char(sh.chaDate,'yyyymm') between '"+firstDate+"' and '"+lastDate+"' and sh.memberId="+memberId+"";取数据的代码
    for(int i=0;i<listsh.size();i++){
    System.out.println(listsh.get(i));
    System.out.println(listsh.get(i).getChaDate());
    }报错的信息
    [Ljava.lang.Object;@108c98
    2011-10-21 11:36:02,812 [myScheduler-1] ERROR org.springframework.scheduling.support.MethodInvokingRunnable - Invocation of method 'sendBillViaEdm' on target class [class com.yesmynet.crm.components.CRMAutoJob] failed
    java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.yesmynet.crm.domain.ScoreHistory