SSM - Mybatis core configuration file and multi table operation
1. typeHandlers label
Whether MyBatis sets a parameter in the PreparedStatement or takes a value from the result set, it will use the type processor to convert the obtained value into Java type in an appropriate way. The following table describes some of the default processor types (interceptions).
You can override the type processor or cre ...
Added by pendelton on Mon, 24 Jan 2022 04:40:59 +0200
SSM development novice guide (with educational administration system project)
SSM development novice guide (with educational administration system project)
preface
When learning the SSM framework, friends who learn Java often encounter many problems. Whether they create new projects themselves or download other people's projects and use them, they will encounter some problems that have nowhere to start. So I wrote this ...
Added by Joe on Mon, 24 Jan 2022 00:37:57 +0200
Mybatis source code analysis Mapper file registration and binding
Mybatis is a "sql oriented" persistence layer framework. It can dynamically assemble sql, which is extremely flexible. At the same time, it avoids almost all JDBC code, manually setting parameters and obtaining result sets. Its plug-in mechanism allows intercepting calls at a certain point during the execution of mapped statements, an ...
Added by TimC on Sun, 23 Jan 2022 10:49:22 +0200
Java project: design and implementation of Aiyou travel platform (java+springboot+ssm)
Project significance:
Since the reform and opening up, China's tourism has developed rapidly, but comparatively speaking, the breadth and depth of China's tourism development are far from meeting the needs of economic development and the improvement of people's living standards. With the development of market economy and the further improvemen ...
Added by conquest on Sun, 23 Jan 2022 09:39:00 +0200
Take your own Mybatis notes Part 1
Mybatis
1. Introduction
1.1. What is Mybatis
MyBatis is an excellent persistence layer frameworkIt supports customized SQL, stored procedures, and advanced mapping.MyBatis avoids almost all JDBC code and manually setting parameters and getting resultsMyBatis can use simple XML or annotations to configure and map native types, interfaces and ...
Added by etingwall on Sun, 23 Jan 2022 09:36:19 +0200
Initial Mybatis framework
Learning objectives
Understand the concept of data persistence and ORM principlesUnderstanding the concept of MyBatis is a bit characteristic at the first levelBuild MyBatis environmentUnderstand the difference and relationship between MyBatis and JDBCUnderstand the scope and declaration cycle of core classesMaster the structure and content of ...
Added by dcole on Sun, 23 Jan 2022 01:11:30 +0200
About SpringBoot integration database
Hikari+jdbcTemplate+mysql
pom.xml
<!-- Connection pool, jdbc,Transaction related-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>
<!-- mysql drive-->
...
Added by jockey_jockey on Sat, 22 Jan 2022 09:02:35 +0200
Basic operations of Mybatis on Database
Connect to the database through the XML configuration file and configure the path of the XML file that executes the SQL statement
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments defaul ...
Added by expl0it on Sat, 22 Jan 2022 07:20:28 +0200
Mybatis - use and configuration
CRUD
namespace
The package name in the namespace should be consistent with the package name of Dao/mapper interface
select
id: is the method name in the corresponding namespace
I personally understand that namespace is the interface implemented, and id is the method of rewriting the interface
resultType: the return value type of sql execu ...
Added by fert on Sat, 22 Jan 2022 07:09:38 +0200
Optimize the autoResultMap generation strategy of MyBatisPlus
preface
Using mybatis plus Field type processor , you can easily map data such as arrays and objects directly to entity classes with only one annotation.
@Data
@Accessors(chain = true)
@TableName(autoResultMap = true)
public class User {
private Long id;
...
/**
* be careful!! Mapping annotation must be turned on
*
...
Added by BinaryStar on Sat, 22 Jan 2022 05:22:58 +0200