1. 学习计划 第一天 1.SpringMVC介绍 2.入门程序 3.SpringMVC架构讲解 a) 框架结构 b) 组件说明 4.SpringMVC整合MyBatis 5.参数绑定 a) SpringMVC默认支持的类型 b) 简单数据类型 c) Pojo类型 d) Pojo包装类型 e) 自定义参数绑定 6.SpringMVC和Struts2的区别 第二天 1.高级参数绑定 a) 数组类型的参数绑定 b) List类型的绑定 2.@RequestMapping注解的使用 3.Con
一.单个参数: public List<XXBean> getXXBeanList(String xxCode); <select id="getXXXBeanList" parameterType="java.lang.String" resultType="XXBean"> select t.* from tableName t where t.id= #{id} </select> 其中方法名和ID一致,
一.单个参数: public List<XXBean> getXXBeanList(String xxCode); <select id="getXXXBeanList" parameterType="java.lang.String" resultType="XXBean"> select t.* from tableName t where t.id= #{id} </select> 其中方法名和ID一致,
今天在调试的过程中发现一个bug,把传入的参数写到查询分析器中执行没有问题,但是在程序中执行就报错:org.springframework.jdbc.UncategorizedSQLException : Error setting null parameter. Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: Java.sql.SQLExcepti
mybatis中参数为list集合时使用 mybatis in查询 一.问题描述mybatis sql查询时,若遇到多个条件匹配一个字段,sql 如: select * from user where id in ('23','45','34') , 那么在 mybatis 中该如何实现呢? 二.实现思路1.方法一: java中将满足条件的值 list 转成符合格式的 sql 字符串2.方法二: mybatis的xml文件是基于OGNL表达式实现的,可以将满足条件的list直接传入到xml中,进
MyBatis参数传递方式 情况一:Mapper映射器接口方法参数只有一个且为基本类型 接口方法: public List<UserEntity> selectUserByAge(int age); 映射结果: <select id="selectUserByAge" resultMap="userResultMap"> select * from tb_user where age > #{age}; </select>