博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mybatis中parameterType可以写的别名
阅读量:4578 次
发布时间:2019-06-08

本文共 1008 字,大约阅读时间需要 3 分钟。

 

 

mybatis中parameterType可以写的别名

 

 https://blog.csdn.net/sdzhangshulong/article/details/51749807

_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

 

左侧为mybatis自带的别名,右侧为映射类型

比如parameterType="string"其实映射对应的为String类型

 

  1. <!-- 定义 别名 -->
  2. <typeAliases>
  3. <!--
  4. 单个别名的定义
  5. alias:别名,type:别名映射的类型 -->
  6. <typeAlias type="cn.itcast.mybatis.po.User" alias="user"/>
  7. <!-- 批量别名定义
  8. 指定包路径,自动扫描包下边的pojo,定义别名,别名默认为类名(首字母小写或大写)
  9. -->
  10. <package name="cn.itcast.mybatis.po"/>
  11.  
  12. </typeAliases>

 

  1. resultType:适合使用返回值的数据类型是非自定义的,即jdk的提供的类型 -->
  2. <select id="selectPersonCount" resultType="java.lang.Integer">
  3. select count(*) from
  4. person
  5. </select>

 

    1. <select id="selectPersonByIdWithMap" parameterType="java.lang.Integer"
    2. resultType="java.util.Map">
    3. select * from person p where p.person_id= #{id}

转载于:https://www.cnblogs.com/libin6505/p/9810324.html

你可能感兴趣的文章
oracle的wm_concat函数实现行转列
查看>>
C语 三子棋小游戏
查看>>
[BZOJ 1861] 书架
查看>>
Unity NGUI 批量点击跳转场景
查看>>
送给毕业生的一个学习建议
查看>>
基于redis+lua实现高并发场景下的秒杀限流解决方案
查看>>
Oracle 块修改跟踪 (Block Change Tracking) 说明
查看>>
阿里云 Redis 服务遇到的问题
查看>>
Jwt Token 安全策略使用 ECDSA 椭圆曲线加密算法签名/验证
查看>>
Window2008通过web.config进行限制ip访问
查看>>
浅析门户网站体育赛事CDN加速解决方案
查看>>
启动/关闭xp_cmdshell
查看>>
[PY3]——内置数据结构(8)——解构与封装
查看>>
进程、单线程和多线程
查看>>
python入门(3)python的解释器
查看>>
maven入门(1-3)构建简单的maven项目
查看>>
git 清除本地无效的分支
查看>>
poj1001--Exponentiation
查看>>
Python基础(迭代)
查看>>
webpack -p无效解决方式
查看>>