开发中改动mapper文件后需要重新编译发布, 由于工程比较大非常耗时, 所以为方便快速测试干脆写了一个小java工程. 工程中用到的dao, mapper和实体类都是从工程中拷出来的, 数据库也是同一个. 但是遇到一个比较奇怪的问题
实体类中有一个属性
private Date createTime;
对应该属性数据库中定义的是
create_time datetime
mapper中该属性映射的定义
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
以下是mapper中对应Dao方法SQL语句
<select id="selectByCreateTime" resultMap="userMap">
select * from user
<where>
<if test="createTime != null and createTime !=