ibatis

看源码解决:org.apache.ibatis.binding.BindingException: Parameter '0' not found

二次信任 提交于 2019-12-06 16:23:34
报错信息 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '0' not found. Available parameters are [arg1, arg0, param1, param2] at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) at com.sun.proxy.$Proxy98.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) at org.apache.ibatis.binding.MapperMethod.executeForMany

How load xml files, in IntelliJ IDEA

好久不见. 提交于 2019-12-06 11:11:06
问题 IntelliJ not find xml file under sources folder. example) src/net/saltfactory/domain/PersonSqlMap.xml but, If I copy it and past out folder, IntelliJ find xml file example) out/net/saltfactory/domain/PersonSqlMap.xml I hope that don't copy and past XML files to out folder help me 回答1: First, make sure src is marked as a source folder for your module in Module Settings --> Modules --> --> Sources. Second, make sure the list of recognized resources includes one for XML files ( ?*.xml ) in

Running multiple mysql statements in one transaction in Mybatis migration tool

心不动则不痛 提交于 2019-12-06 10:49:58
问题 I'm using the Mybatis migration tool to maintain the schema to our database but I'm having the following problem. Currently, if we use multiple statements in a migration they are each run in a separate transaction. So if I want to alter 2 tables (or run multiple statements) as part of a feature and one of them breaks, any that were run first have to be manually reverted. The mybatis migration however is only marked as complete in the changelog table if all statements completed successfully.

Mybatis报错:org.apache.ibatis.builder.IncompleteElementException

吃可爱长大的小学妹 提交于 2019-12-06 05:43:06
org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer 遇到这种问题,一般都是因为在xml中基本类型返回属性的属性名写成了resultMap。 由于Mybatis的报错的定位文件有时候不准,所以不要只看错误信息中提到的文件关联的文件,所以ctrl+alt+h 全工程内检索(可能你的全文检索不是这个快捷键), resultMap="java.lang.Integer"(不同的人编码风格不同,有的可能会有空格,自行调整)。最后在另一个不相干的XXXmapper.xml文件中找到了这行 resultMap="java.lang.Integer" 改为: resultType="java.lang.Integer" 来源: https://www.cnblogs.com/yoyotl/p/11964476.html

How to Select a BLOB column from database using iBatis

会有一股神秘感。 提交于 2019-12-06 05:26:18
问题 One of a table's column is of BLOB datatype (Oracle 10g). We have a simple select query executed via iBatis to select the BLOB column and display it using Struts2 & JSP. The result tag in the iBatis xml file had the jdbctype as java.sql.Blob <result property="uploadContent" column="uploadcontent" jdbctype="Blob"/> Should we be mentioning any typeHandler class for Blob column ? Currently we are getting an error stating column type mismatch. Note: This column is selected and mapped into a java

org.apache.ibatis.binding.BindingException: Mapper method &apos;com... has an unsupported return type

落花浮王杯 提交于 2019-12-06 04:39:46
解决: mapper文件中的update,delete,insert语句是不需要设置返回类型的,它们都是默认返回一个int,所以应该修改dao层接口的方法: Integer updateActiveId(Map<String, Object> updateIdMap); 或者 void updateActiveId(Map<String, Object> updateIdMap); 来源: https://my.oschina.net/u/4049480/blog/3135744

iBATIS - Defining 'javaType' and 'jdbcType'

删除回忆录丶 提交于 2019-12-06 02:49:32
问题 While defining the resultMap in iBatis, it provides an option to set the javaType and jdbcType for each property to column mapping. e.g. <resultMap id="employee" class="com.mycompany.Employee"> <result property="firstName" column="first_name" javaType="?" jdbcType="?"/> </resultMap> Wanted to know that when we should be defining the javaType and jdbcType ? I have seen mapping where it just works without defining these properties and in others we have to define them. EDIT: See the selected

maven工程报错 org.apache.ibatis.binding.BindingException

左心房为你撑大大i 提交于 2019-12-05 20:40:14
异常现象: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.appsys.dao.backenduser.BackendUserMapper.getLoginUser at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:178) at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:38) at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42) at com.sun.proxy.$Proxy12.getLoginUser(Unknown Source) at cn.appsys.service.backend.BackendUserServiceImpl.login(BackendUserServiceImpl.java:17) at cn

好程序员Java教程分享几个流行的Java框架

你说的曾经没有我的故事 提交于 2019-12-05 19:52:37
  好程序员Java教程分享几个流行的Java框架 一.springmvc框架 简介:SpringWebMVC是一种基于Java的实现了WebMVC设计模式的请求驱动类型的轻量级Web框架,即使用了MVC架构模式的思想,将web层进行职责解耦,基于请求驱动指的就是使用请求-响应模型,框架的目的就是帮助我们简化开发,SpringWebMVC也是要简化我们日常Web开发的。 优点: 1.调理清晰,控制器(controller)、验证器(validator)、命令对象(commandobect)、表单对象(formobject)、模型对象(modelobject)、Servlet分发器(DispatcherServlet)、处理器映射(handlermapping)、试图解析器(viewresoler)等等,让你学习时能层次分明。 2、分工明确,而且扩展点相当灵活,可以很容易扩展,虽然几乎不需要; 3、由于命令对象就是一个POJO,无需继承框架特定API,可以使用命令对象直接作为业务对象; 4、和Spring其他框架无缝集成,是其它Web框架所不具备的; 5、可适配,通过HandlerAdapter可以支持任意的类作为处理器; 6、可定制性,HandlerMapping、ViewResolver等能够非常简单的定制; 7、功能强大的数据验证、格式化、绑定机制; 8

mysql进行activiti自动生成数据库表时出现的各种问题

扶醉桌前 提交于 2019-12-05 19:43:19
最近项目上需要用到activit,后来网上了解了下需要创建对应的23张表,是可以通过一个代码来自动生成的,但是我操作的过程中遇到了很多问题: 首先生成库的代码如下: // 使用代码创建activiti需要的23个表 @Test public void creteTable() { ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration .createStandaloneProcessEngineConfiguration(); // 连接数据库的配置 // 配置数据库驱动:对应不同数据库类型的驱动 processEngineConfiguration.setJdbcDriver("com.mysql.jdbc.Driver"); // 配置数据库的JDBC URL processEngineConfiguration .setJdbcUrl("jdbc:mysql://localhost:3306/activiti?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf8"); // 配置连接数据库的用户名 processEngineConfiguration.setJdbcUsername(