为了账号安全,请及时绑定邮箱和手机立即绑定

MyBatis日期类型 如何与SQLServer和java中的日期匹配的,

MyBatis日期类型 如何与SQLServer和java中的日期匹配的,

22不小了 2015-08-02 11:29:12
SQL Server 的SQL语句:    ID                   int                      CreateTime           Timestamp            FileAdd              varchar(100)MyBatis配置: <resultMap type="instrrmentmodel" id="instrrmentmodelMap">         <id property="ID" column="ID"/>        <result property="CreateTime" column="CreateTime"  javaType="java.sql.Timestamp" jdbcType="TIMESTAMP"/>          <result property="FileAdd" column="FileAdd"/>     </resultMap>TInstrrmentModel实体类部分代码:     private  Integer    ID  ;                    private   Timestamp  CreateTime ;                 private String   FileAdd    ; public String  getCreateTime() {        return  new SimpleDateFormat("yyyy:MM:DD").format(CreateTime);    }    public void setCreateTime(Timestamp createTime) {                CreateTime = createTime;    }无条件查结果:严重: Servlet.service() for servlet [MVC] in context with path [/EnterpriseEMS] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database.  Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for sbzy.enterpriseems.model.domain.InstrrmentModel.selectList### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for sbzy.enterpriseems.model.domain.InstrrmentModel.selectList] with root causejava.lang.IllegalArgumentException: Mapped Statements collection does not contain value for sbzy.enterpriseems.model.domain.InstrrmentModel.selectList这个数据类型如何匹配呢!要命的很搞了半天
查看完整描述

1 回答

?
慕粉4165865

TA贡献1条经验 获得超0个赞

 javaType="java.sql.Timestamp"要用工具的时间戳,应该是 javaType="java.util.Timestamp"

查看完整回答
反对 回复 2017-04-25
  • 1 回答
  • 1 关注
  • 6864 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信