Tkmybatis Mybatis framework is based on a tool developed by calling the method which provides for data operations on a single table, you do not need to write any sql statement, which greatly improves the efficiency of project development.
1: Tkmybatis use
pom.xml to add dependencies
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>2.0.3-beta1</version>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>4.0.0</version>
Create Entity database table corresponding to the class object
create table TK_TEST (tk_id INTEGER not null , tk_name VARCHAR2 (50), tk_date DATE, tk_clob CLOB)
Annotations:
the @Table
description database table information, the main attributes name (table name), schema, catalog, uniqueConstraints and so on.
@Id
specify the primary key column, no attribute value.
@Column
description field information database, mainly attributes name (field names), columnDefinition, insertable, length, nullable ( whether empty), precision, scale, table, unique, updatable and the like.
@ColumnType
description database field types, can be arranged for some special types, for