zoukankan      html  css  js  c++  java
  • mybatis typeAliases 说明

    类型别名可为 Java 类型设置一个缩写名字。 它仅用于 XML 配置,意在降低冗余的全限定类名书写。例如:

    <typeAliases>
      <typeAlias alias="Author" type="domain.blog.Author"/>
      <typeAlias alias="Blog" type="domain.blog.Blog"/>
      <typeAlias alias="Comment" type="domain.blog.Comment"/>
      <typeAlias alias="Post" type="domain.blog.Post"/>
      <typeAlias alias="Section" type="domain.blog.Section"/>
      <typeAlias alias="Tag" type="domain.blog.Tag"/>
    </typeAliases>


    当这样配置时,Blog 可以用在任何使用 domain.blog.Blog 的地方。

    也可以指定一个包名,MyBatis 会在包名下面搜索需要的 Java Bean,比如:

    <typeAliases>
      <package name="domain.blog"/>
    </typeAliases>




    下面是一些为常见的 Java 类型内建的类型别名。它们都是不区分大小写的,注意,为了应对原始类型的命名重复,采取了特殊的命名风格。

    别名映射的类型
    _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
    object Object
    map Map
    hashmap HashMap
    list List
    arraylist ArrayList
    collection Collection
    iterator Iterator

    本文来自博客园,作者:咸瑜,转载请注明原文链接:https://www.cnblogs.com/bi-hu/p/15219094.html

  • 相关阅读:
    B
    A
    UVA
    马的移动(BFS) 详细注释 一个具有情怀的题目
    JAVA JDK 环境变量配置--简单图解
    linux系统(rpm与deb环境),JAVA JDK的配置
    Jmeter接口测试+压力测试+环境配置+证书导出
    LR访问Https接口
    GitHub linux 提交文件及403错误处理
    random模块写的验证码
  • 原文地址:https://www.cnblogs.com/bi-hu/p/15219094.html
Copyright © 2011-2022 走看看