有一个user表和一个address表,他们是一对多的关系,在user.getAddress()的时候, 1.在hibernate中,对user查询后能得到地址的相关信息(前提是对user进行查询后session不能关 闭,否则也会和spring+hibernate中报一样的错) 2.在spring+hibernate中就会报错,failed to lazily initialize a collection of role: com.bean.User.address, no session or session was closed,把user.hbm.xml中的lazy改 ...
linxiao
搜索本博客
博客分类
最近加入圈子
最新评论
评论排行榜