对于
org.apache.ibatis.executor.ExecutorException: There was no TypeHandler found for parameter...这个异常,是由于javaType和jdbcType的类型不匹配造成的。
<insert id="add" parameterType="Message">
insert into t_message(id,content,createtime,t_student_id,t_class_id)
values(#{id},#{content},#{createTime},#{student},#{class})
</insert>
我的数据库里,t_student_id和t_class_id是varchar类型,Message里面有student和class对象,所以直接按上面方案配置,就会报typehandler异常,解决方法也很简单:
<insert id="add" parameterType="Message">
insert into t_message(id,content,createtime,t_student_id,t_class_id)
values(#{id},#{content},#{createTime},#{student.id},#{class.id})
</insert>
用直接类似EL表达式的方式即可绑定你想给定的数据类型 !
分享到:
相关推荐
搭建mybatis所需包org.apache.ibatis.annotations.Param @Param
主要介绍了Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法的相关资料,需要的朋友可以参考下
ibatis-2.3.4.726.jar,ibatis-2.3.0.677.jar,ibatis-2.3.3.720.jar下载,都已放入一个压缩包下。
│ │ │ frame-sourcefiles-org.apache.ibatis.executor.loader.cglib.html │ │ │ frame-sourcefiles-org.apache.ibatis.executor.loader.html │ │ │ frame-sourcefiles- org.apache.ibatis.executor.loader...
org.apache.ibatis.logging org.apache.ibatis.logging.commons org.apache.ibatis.logging.jdbc org.apache.ibatis.logging.jdk14 org.apache.ibatis.logging.log4j org.apache.ibatis.logging.log4j2 org.apache....
纵观目前主流的 ORM(对象关系映射),无论 Hibernate还是Apache OJB,都对数据库结构提供了较为完整的封装,提供了从POJO到数据库表的全套映射机制。程序员往往只需定义好了POJO 到数据库表的映射关系,即可通过 ...
apache开源项目源码ibatis-3-core-src-3.0.0.227 ibatis框架java源程序 spring,struts,hibernate,ibatis,框架源码 各种ibatis框架应用源码,你会从中得到意想不到的效果! apache开源组织开发的开源项目源码,其...
Caused By: org.apache.ibatis.builder.BuilderException: Could not find SQL statement to include with refid 'SAD02.SAD02_COL' at org.apache.ibatis.builder.xml.XMLStatementBuilder$IncludeNodeHandler....
出现以上的情况主要的原因是因为在主配置文件标签没正确的指向映射接口的配置文件。 解决方案:1.检查的name是否正确,如我的name属性填的就是com.it.dao 2、检查的class属性或resource属性,我resource这里写的是...
IBatisNet.Common.1.6.2、IBatis.DataAccess.1.9.2、IBatis.DataMapper.1.6.2
log4j.addivity.org.apache=true log4j.logger.com.ibatis = ERROR log4j.logger.com.ibatis.common.jdbc.SimpleDataSource = ERROR #log4j.logger.com.ibatis.common.jdbc.ScriptRunner = ERROR #log4j....
大家都要用到IBATIS框架时,连接到MYECLIPSE驱动JAR包
要大于20个字符要大于20个字符要大于20个字符要大于20个字符要大于20个字符要大于20个字符要大于20个字符要大于20个字符要大于20个字符
org.apache.ibatis org.apache.juli 4号包: org.apache.tiles org.apache.velocity org.apache.xerces org.apache.xml org.apache.xmlbeans org.apache.xmlcommons org.apache.derby org.apache.poi org.apache....
org.apache.ibatis org.apache.juli 4号包: org.apache.tiles org.apache.velocity org.apache.xerces org.apache.xml org.apache.xmlbeans org.apache.xmlcommons org.apache.derby org.apache.poi org.apache....
org.apache.ibatis org.apache.juli 4号包: org.apache.tiles org.apache.velocity org.apache.xerces org.apache.xml org.apache.xmlbeans org.apache.xmlcommons org.apache.derby org.apache.poi org.apache....
org.apache.ibatis org.apache.juli 4号包: org.apache.tiles org.apache.velocity org.apache.xerces org.apache.xml org.apache.xmlbeans org.apache.xmlcommons org.apache.derby org.apache.poi org.apache....
org.apache.ibatis org.apache.juli 4号包: org.apache.tiles org.apache.velocity org.apache.xerces org.apache.xml org.apache.xmlbeans org.apache.xmlcommons org.apache.derby org.apache.poi org.apache....
org.apache.ibatis org.apache.juli 4号包: org.apache.tiles org.apache.velocity org.apache.xerces org.apache.xml org.apache.xmlbeans org.apache.xmlcommons org.apache.derby org.apache.poi org.apache....