首页 > 其他分享 >MyBatis 随笔

MyBatis 随笔

时间:2023-03-30 18:23:50浏览次数:38  
标签:parameterType java 接口 参数 MyBatis 随笔 MinggeQingchun

MyBatis传参parameterType
parameterType:接口中方法参数的类型, 类型的完全限定名或别名

如:parameterType = "java.lang.Integer" parameterType = "int"

这个属性是可选的,因为可以推断出具体传入语句的参数,默认值为未设置(unset)。接口中方法的参数从 java 代码传入到 mapper 文件的 sql 语句

注:

parameterType 不是强制的,MyBatis 通过反射机制 能够发现接口参数的数据类型 可以省略不写(一般省略不写)

 

 

 

 

 

 

别名
映射的类型
_byte
byte
_long
long
_short
short
_int
int
_integer
int
_double
double
_float
float
_boolean
boolean
string
String
byte
Byte
long
Long
short
Short
int
Integer
integer
Integer
double
Double
float
Float
boolean
Boolean
date
Date
decimal
BigDecimal
bigdecimal
BigDecimal
mapMap/HashMap————————————————版权声明:本文为CSDN博主「MinggeQingchun」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。原文链接:https://blog.csdn.net/MinggeQingchun/article/details/122754507

标签:parameterType,java,接口,参数,MyBatis,随笔,MinggeQingchun
From: https://www.cnblogs.com/opdosog/p/17273926.html

相关文章

  • Mybatis动态SQL映射
    Mybatis动态SQL映射动态SQL映射1.if结构test里面的and或or必须小写2.trim-if多条件结构3.where-if多条件结构4.choose-when-otherwise多选一结构5.foreach循环结......
  • Spring-Mybatis整合的所需配置文件
    Spring-Mybatis整合database.properties文件driver=com.mysql.jdbc.Driverurl=jdbc:mysql://127.0.0.1:3306/smbms?useUncode=true&characterEncoding=utf-8uname=rootpa......
  • Mybatis面向切面编程(AOP)的applicationContext配置文件
    面向切面编程(AOP)applicationContext.xml配置文件<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans" xmlns:xsi="ht......
  • SpringMVC整合的 spring-mvc spring-mybatis配置文件
    SpringMVC入门spring-mvc.xml配置文件<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.......
  • mybatis添加提交事务方法
    方法一利用commit();方法//提交事务sqlSession.commit();方法二在获取sqlSession对象的时候,自动提交事务 MyBatis事务:openSession():默认开......
  • 存储动态列的结果集(行列互转)--java、mybatis、orcale
    业务上需要存储动态列的数据通过行列互转的方式实现数据库中动态列的几种设计思路使用数据库DDL进行动态创建使用数据库预留字段(宽表)使用数据库中的json数据......
  • mybatis学习笔记
    1、第一个mybatis导入依赖//mysql依赖<dependency><groupId>com.mysql</groupId><artifactId>mysql-connector-j</artifactId><version>8.0.31</v......
  • Mybatis-Plus自定义TypeHandler映射JSON类型为List
    1.实体类注意点:别忘了autoResultMap=true@Data@TableName(value="report",autoResultMap=true)publicclassReportimplementsSerializable{privates......
  • 在mybatis的xml文件中如何使用test标签
    1.等于条件的两种写法①将双引号和单引号的位置互换<!--test标签用来条件判断,为true则执行标签下的sql--><iftest='testString!=nullandtestString=="A"'>......
  • 狂神说MyBatis01:第一个程序
    1.简介1.1什么是MyBatisMyBatis是一款优秀的持久层框架MyBatis避免了几乎所有的JDBC代码和手动设置参数以及获取结果集的过程MyBatis可以使用简单的XML或注解......