标题:hibernate查询结果现实问题
取消只看楼主
wangxin016
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-7-21
 问题点数:0 回复次数:0 
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
是查询方法不对,还是哪里不对啊?请大家帮帮忙
搜索更多相关主题的帖子: hibernate 现实 obj iter 结果 
2008-08-11 09:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-227652-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.341622 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved