Mybatis怎么在mapper中用多个参数
来源:互联网 发布:杭州小知科技 知乎 编辑:程序博客网 时间:2024/05/01 11:33
原文地址:https://github.com/mybatis/mybatis-3/wiki/FAQ
How do I use multiple parameters in a mapper?
Java reflection does not provide a way to know the name of a method parameter so MyBatis names them by default like: param1, param2...
If you want to give them a name use the @param annotation this way:
import org.apache.ibatis.annotations.Param;public interface UserMapper { User selectUser(@Param("username") String username, @Param("hashedPassword") String hashedPassword);}
Now you can use them in your xml like follows:
<select id=”selectUser” resultType=”User”> select id, username, hashedPassword from some_table where username = #{username} and hashedPassword = #{hashedPassword}</select>
0 0
- Mybatis怎么在mapper中用多个参数
- mybatis mapper 传入多个参数方法
- mybatis 扫描多个mapper
- mybatis mapper参数解析
- Spring读取mybatis在多个jar包下的的mapper文件
- 使用mybatis时Mapper.xml文件中如何判断多个参数不为空和null
- MyBatis中mapper接口方法多参数传入
- 在Mybatis中使用注解@多个参数查询
- mybatis多个参数类型不同,sql语句中paramterType怎么写?
- Mybatis传递多个参数
- Mybatis传递多个参数
- Mybatis传递多个参数
- mybatis传递多个参数
- mybatis传递多个参数
- Mybatis传递多个参数
- MyBatis传入多个参数
- Mybatis传递多个参数
- MyBatis传递多个参数,
- apache 二级域名设置完整步骤
- javascript 随机取任意四个字母和随机生成一个名字
- 栈(卡特兰数模板)
- 利用低端哨实现顺序表的查找
- js实现文本框赋值_value与innerHTML区别
- Mybatis怎么在mapper中用多个参数
- javascript 5秒钟刷新和页面title滚动
- Android 文件打开文件
- hihocoder1388 Periodic Signal
- linux shell program summary
- 软件工程—软件开发模型
- 【数据结构基础篇】树和二叉树之间的转换
- Assembly Note
- 设计优化(1)单例模式