您的位置:首页 > 编程语言 > Java开发

struts2 中映射文件 一个列在resultMap中引用2次必须都列出来

2016-12-02 20:00 736 查看
private Integer id;
private String userName;
private String userPwd;
private String nickName;
private Date birthday;
private Picture pic;

<resultMap type="User" id="userMap">

<id property="id" column="id"/>

<association property="pic" column="id" 

javaType="Picture" select="nsPic.findByU_id">

</association>

</resultMap>

找了好久才发现,如果在userMap<id property="id" column="id"/>列出,user.id
一直默认空值。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: