Exception in thread "main" org.apache.ibatis.binding.BindingException: Mapper method 'com.demo.DAO.B
2017-11-20 18:53
369 查看
今天在学习MyBatis的时候,在进行配置sql语句的时候,在进行增删改操作的时候,犯了一个低级错误,报了下面的错误:
Exception in thread "main" org.apache.ibatis.binding.BindingException: Mapper method 'com.demo.DAO.BrandDAO.insertBrand attempted to return null from a method with a primitive return type (boolean).
找了好久才发现,原来是标签写错了:
错误的时候的写法:
后来发现了错误,在执行插入操作的时候,标签不再是select了,而应该跟着转换为insert
这就是一个细心问题,发出来供大家参考一下。
Exception in thread "main" org.apache.ibatis.binding.BindingException: Mapper method 'com.demo.DAO.BrandDAO.insertBrand attempted to return null from a method with a primitive return type (boolean).
找了好久才发现,原来是标签写错了:
错误的时候的写法:
<select id="insertBrand" parameterType="Brand">
insert into brand(brand_name) values(#{brandName}) </select>
后来发现了错误,在执行插入操作的时候,标签不再是select了,而应该跟着转换为insert
<insert id="insertBrand" parameterType="Brand"> insert into brand(brand_name) values(#{brandName}) </insert>
这就是一个细心问题,发出来供大家参考一下。
相关文章推荐
- Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not
- MyBatis笔记----报错:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法
- org.apache.ibatis.binding.BindingException: Mapper method 'com.zbiti.alarm.dao.AlarmDao.queryTest at
- 【spring boot Mybatis】报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.newhope.interview.dao.UserMapper.add
- Mybatis错误(一)Exception in thread &quo 4000 t;main" org.apache.ibatis.exceptions.PersistenceException:
- 解决Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.png.mapper.User
- Hadoop分布式集群 EclipseException in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputExce
- Exceptionin thread "main" java.lang.UnsatisfiedLinkError:org.apache.hadoop.util.NativeCrc32.nativeCo
- Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : U
- Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException
- Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path
- Invocation of init method failed; nested exception is org.apache.ibatis.binding.BindingException: In
- 项目提示:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactor
- Exceptioninthread"main"java.lang.NoClassDefFoundError:org/apache/hadoop/util/ProgramDriver
- Exception in thread "main" java.lang.NoClassDefFoundError: Demo (wrong name: com/zhangyun/Demo)解决办法
- Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/l
- 提交spark的代码的时候出现Exception in thread "main" org.apache.SparkException:Yarn application has already end
- 安装maven出现错误:Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/
- Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/Nestabl