hibernate查询结果现实问题
程序代码:
public static void main(String[] args) { UinfoDAO dao = new UinfoDAO(); Object obj = (Object)"wx"; try{ Uinfo uinfo = new Uinfo(); uinfo.setUname("wx"); Collection list = dao.findByUname(obj); Iterator iter = list.iterator(); while (iter.hasNext()) { System.out.println("Sign is :" + iter.next().toString()); } }catch(HibernateException e){ System.out.println("Entity retrieval failed."); e.printStackTrace(); }finally{ try{ dao.getSession().close(); }catch(Exception e){ //do nothing; } } } }
结果为Sign is :com.genuitec.hibernate.Uinfo@1a3e41f
是查询方法不对,还是哪里不对啊?请大家帮帮忙