mybatisplus jdbcType
时间: 2023-09-09 18:06:13 浏览: 102
MyBatis-Plus is an open-source Java persistence framework that enhances the functionalities of MyBatis, a popular data access framework. When using MyBatis-Plus, you can specify the JDBC type for a parameter or result to ensure proper data mapping between Java and the database.
In MyBatis-Plus, you can specify the JDBC type using the `jdbcType` attribute. This attribute can be set on the `@TableField`, `@TableId`, `@TableLogic`, `@TableSql`, `@TableSplit`, and `@TableType` annotations.
Here's an example of how to use the `jdbcType` attribute:
```java
@TableField(jdbcType = JdbcType.INTEGER)
private Integer age;
```
In this example, the `age` field is annotated with `@TableField` and specifies the JDBC type as `INTEGER`. This ensures that when MyBatis-Plus maps the `age` field to the database, it uses the appropriate JDBC type.
You can refer to the MyBatis-Plus documentation for more information on how to use the `jdbcType` attribute and other features provided by MyBatis-Plus.
阅读全文