zoukankan      html  css  js  c++  java
  • mybatis中jdbcType和javaType

    1、MyBatis 通过包含的jdbcType类型

    BIT、FLOAT、CHAR 、TIMESTAMP 、 OTHER 、UNDEFINEDTINYINT 、REAL 、VARCHAR 、BINARY 、BLOB NVARCHAR、SMALLINT 、DOUBLE 、LONGVARCHAR 、VARBINARY 、CLOB、NCHAR、INTEGER、 NUMERIC、DATE 、LONGVARBINARY 、BOOLEAN 、NCLOB、BIGINT 、DECIMAL 、TIME 、NULL、CURSOR

    2、Mybatis中javaType和jdbcType对应和CRUD例子

    <resultMap type="java.util.Map" id="resultjcm">
      <result property="FLD_NUMBER" column="FLD_NUMBER" javaType="double" jdbcType="NUMERIC"/>
      <result property="FLD_VARCHAR" column="FLD_VARCHAR" javaType="string" jdbcType="VARCHAR"/>
      <result property="FLD_DATE" column="FLD_DATE" javaType="java.sql.Date" jdbcType="DATE"/>
      <result property="FLD_INTEGER" column="FLD_INTEGER"  javaType="int" jdbcType="INTEGER"/>
      <result property="FLD_DOUBLE" column="FLD_DOUBLE"  javaType="double" jdbcType="DOUBLE"/>
      <result property="FLD_LONG" column="FLD_LONG"  javaType="long" jdbcType="INTEGER"/>
      <result property="FLD_CHAR" column="FLD_CHAR"  javaType="string" jdbcType="CHAR"/>
      <result property="FLD_BLOB" column="FLD_BLOB"  javaType="[B" jdbcType="BLOB" />
      <result property="FLD_CLOB" column="FLD_CLOB"  javaType="string" jdbcType="CLOB"/>
      <result property="FLD_FLOAT" column="FLD_FLOAT"  javaType="float" jdbcType="FLOAT"/>
      <result property="FLD_TIMESTAMP" column="FLD_TIMESTAMP"  javaType="java.sql.Timestamp" jdbcType="TIMESTAMP"/>
     </resultMap>

    3、Mybatis中javaType和jdbcType对应关系

       JDBCType            JavaType
        CHAR                String
        VARCHAR             String
        LONGVARCHAR         String
        NUMERIC             java.math.BigDecimal
        DECIMAL             java.math.BigDecimal
        BIT                 boolean
        BOOLEAN             boolean
        TINYINT             byte
        SMALLINT            short
        INTEGER             int
        BIGINT              long
        REAL                float
        FLOAT               double
        DOUBLE              double
        BINARY              byte[]
        VARBINARY           byte[]
        LONGVARBINARY               byte[]
        DATE                java.sql.Date
        TIME                java.sql.Time
        TIMESTAMP           java.sql.Timestamp
        CLOB                Clob
        BLOB                Blob
        ARRAY               Array
        DISTINCT            mapping of underlying type
        STRUCT              Struct
        REF                 Ref
        DATALINK            java.net.URL[color=red][/color]
  • 相关阅读:
    font-family常见字体
    MongoDB numa系列问题三:overcommit_memory和zone_reclaim_mode
    MongoDB numa系列问题二:WARNING: You are running on a NUMA machine.
    MongoDB numa系列问题一:[initandlisten] connection refused because too many open connections:
    MongoDB高可用架构:Replica Sets+Sharding
    MongoDB分片配置系列一:
    MongoDB副本集配置系列一:安装MongoDB
    MongoDB副本集配置系列二:配置MongoDB副本集
    Mongostat 2.6详解
    【MongoDB:】稍微复杂的操作
  • 原文地址:https://www.cnblogs.com/jxxblogs/p/12671554.html
Copyright © 2011-2022 走看看