1 failed to lazily initialize a collection of role: com.gmako.entity.UserInfo.extendsUserInfos, no session or session was closed
这是懒加载异常 配置文件设置lazy为false
<set name="sysuser"" inverse="true" lazy-="false">
<key>
<column nam"xxid"/>//主键ID
</key>
<one-many class="pojo.sysuser">
</set>
=================================================
多对多关系配置
private Set<SysRight>sysRight=new HashSet(0);
//table 是数据库中存有两者关系的表名
<set name="sysRight" table="sys_role_right" lazy="false" inverse="true">
<key>
//自己表在连接表中的列名
<column name="roles_id">
</key> //对方表在连接表中的列名
<many-to-many column="right_id" class="pojo.SysRight"></many-to-many>
</set>