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
一直默认空值。
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
一直默认空值。
相关文章推荐
- sudo yum upgrade nss解决java.security.KeyException错误
- Spring 使用JSTL标签显示后台数据
- Java设计模式之代理模式
- Java实现(01)——工厂模式(Factory Pattern)
- spring声明式事务 同一类内方法调用事务失效
- 深入理解java 整型数, Integer的缓存
- java基础部分总结
- Java “Unhandled exception type Exception”错误提示 (转)
- spring mvc3的注解@ResponseBody 自动返回jason
- 消息队列RabbitMQ与Spring
- springMVC笔记系列(15)——模型数据处理篇 之 @Session注解
- Spring Boot 学习第二步 配置MySQL数据库+JPA
- Spring Boot 学习第一步(搭建初步环境)
- eclipse bug之No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK
- 9.6 遗留的集合类
- 9.5 算法
- 9.4 视图和包装器
- springMVC笔记系列(14)——模型数据处理篇 之 Map
- 9.3 映射
- 9.2 具体集合