
mybatis+ibatis
coci曹
这个作者很懒,什么都没留下…
展开
-
mybatis报错:当要返回刚刚插入数据的id时
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result原创 2015-12-18 21:25:18 · 9944 阅读 · 0 评论 -
mybaties报错:查询数据时,没有给无参构造报错
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class com.coc原创 2015-12-18 21:05:46 · 1884 阅读 · 0 评论 -
mybatis开发DAO的2种方法
第一种原始dao开发,程序猿要写dao接口和dao实现类。第二种mapper代理,程序猿只要写mapper接口,但是需要注意以下4个开发规范。1,在mapper.xml中的nameSpace(命名空间),要和mapper接口的地址相同2,mapper.java接口中的方法名和mapper.xml中的statement的id一致mapper.xml中这样写:原创 2015-12-19 13:00:36 · 782 阅读 · 0 评论 -
mybatis报错:mappers映射接口时:<mapper class="com.coci.mapperDao.IUserDAo"/>
org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession.### The error may exist in SQL Mapper Configuration### Cause: org.apache.ibatis.builder.BuilderException: Error c原创 2015-12-19 15:14:11 · 3224 阅读 · 2 评论 -
mybatis报错:批量设置别名时
org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession.### The error may exist in SQL Mapper Configuration### Cause: org.apache.ibatis.builder.BuilderException: Error c原创 2015-12-19 14:25:39 · 2806 阅读 · 1 评论 -
java.sql.SQLSyntaxErrorException 无效的主机/绑定变量名
ibatis.xml中 insert语句中 value里面的值之间少了一个逗号insert into 表values( #reportNo#, #agentCode# //这里少了一个逗号 #accidentCode#)原创 2018-05-30 19:57:53 · 998 阅读 · 0 评论 -
ibatis传入数组或List类型参数小结
转载自:https://blog.youkuaiyun.com/bruce128/article/details/22098795小结一下ibatis框架下,传入参数为数组类型或者是List类型的sql写法。特别说明,iterate标签仅支持数组和List类型,如果传入Set,Map或其它集合类型,Ibatis会抛异常。 1. 传入数组类型,不需要标明parameterClasss,数组和List类型...转载 2018-06-08 18:42:27 · 1684 阅读 · 0 评论 -
Ibatis 后台打印完整的sql语句
转载自:https://blog.youkuaiyun.com/z69183787/article/details/46505221亲测有效,测得第二种今天转换数据,遇到了用ibatIS做持久层的系统,弄不清数据的关联关系,就想着打印出后台SQL出来,在网上找了找相关的方法,现在记录下来以便以后自己用着方便。ibatIS的配置文件有两种,一种是xml的,一种是properties的。我用的是xml文件的,也把...转载 2018-06-08 18:44:00 · 2655 阅读 · 0 评论