hibernate查询出来的数据和数据库中不一致!!!
yuga 2006-10-25 03:02:26 发布成EJB,weblogic
引擎定时改变数据库中标志为01改称03
改完后,页面调用EJB查询,查出的结果还是01
修改的地方:
lpst.setFlag("03");
session.update(lpst);
session.flush();
session.evict(lpst);
trans.commit();
查询:
pqcls = session.createQuery("from com.richlottery.core.beans.hibernate.LeLottperiod as Lottperiod " +
"where Lottperiod.lotterycode=:lotteryCode and Lottperiod.flag=:flag");
pqcls.setParameter("lotteryCode", lotteryCode);
pqcls.setParameter("flag", "03");
pclslist = pqcls.list();
这条数据是用"03"查出来的(数据库中也是03,改好了),但是
String strFlag = period.getFlag();
System.out.println(strPeriodNo + " 标志位:" + strFlag);
打印出来的是"01"
就是说:我用03查出的记录,读的时候里面是01
想不通