Mybatis implements data addition, deletion, modification and query (detailed explanation)

catalogue 1. Construction project 1. Build experimental database 2. Import relevant jar packages 3. Create a configuration file for mybatis 4. Create a tool class for the key objects SqlSessionFactory and SqlSession of mybatis 5. Build entity class 6. Interface 7. mapper file 8. Directory structure diagram "Check" operation ...

Posted by jmantra on Wed, 19 Jan 2022 22:47:33 +0100

Mybatis learning record

Mybatis 1. Run the first mybatis program 1.1 import <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.47</version> </dependency> <dependency> <groupId>org.mybatis</group ...

Posted by wednesday on Wed, 19 Jan 2022 21:33:43 +0100

MyBatis Study Guide - result mapping and dynamic SQL

1. Complex mapping 1.1 result mapping 1.1.1 basic concepts resultType: if the attribute name of the entity is consistent with the field name in the table, the query results will be automatically encapsulated into the entity classResutlMap: if the attribute name of the entity is inconsistent with the field name in the table, you can use Resut ...

Posted by azaidi on Wed, 19 Jan 2022 16:17:25 +0100

What about MyBatis annotation development of SSM / MyBatis annotation development in IDEA? How to use the MyBatis annotation?

Write before: Continue to record your MyBatis learning journey. If you don't understand it, it is recommended to read it first Previous blogs , detailed codes can be found in My Gitee warehouse SSM learning Clone download learn to use! 3.11 annotation development 3.11.1 notes MyBatis can also be developed with annotations to reduce the writi ...

Posted by charlieholder on Wed, 19 Jan 2022 12:05:18 +0100

Spring Boot quickly integrates TK Mybatis

introduce TKMybatis is a tool developed based on the Mybatis framework. It internally implements the basic data operation of a single table. It can complete the single table operation without writing any sql by simply inheriting the interface provided by TKMybatis. Add dependency Add TKMybatis dependency <dependency> <group ...

Posted by diode on Tue, 18 Jan 2022 02:05:57 +0100

Are you still foolishly manually adding the creator and creation time in sql? A general skill that senior development engineers have to know!

background In the process of database design, we often add some general fields to database tables, such as creator, creation time, modifier and modification time. Sometimes, in the design process of some companies, each table is forced to contain these basic information in order to record some basic log records during data operation. According ...

Posted by not_john on Mon, 17 Jan 2022 12:11:04 +0100

Crazy God says Mybatis class notes

Mybatis-7.9 1. Introduction 1.1. What is Mybatis MyBatis is an excellent persistence layer frameworkIt supports custom SQL, stored procedures, and advanced mappingMyBatis eliminates almost all JDBC code and the work of setting parameters and obtaining result setsMyBatis can configure and map primitive types, interfaces and Java POJO s (Plain ...

Posted by nigeledge on Mon, 17 Jan 2022 02:28:11 +0100

Mybatis Reverse Engineering (java configuration implementation)

Various reverse engineering articles viewed on the Internet found that they are basically implemented in the way of xml configuration. Now basically, projects use java classes to realize xml configuration. Therefore, in sorting out the implementation methods of pure java annotations, we must pay attention to that the implementation methods of j ...

Posted by davestewart on Sun, 16 Jan 2022 21:53:11 +0100

SqlSession used by mybatis spring

In MyBatis, you can use SqlSessionFactory to create SqlSession. Once you get a session, you can use it to execute mapped statements, commit or rollback connections, and finally close the session when it is no longer needed. After using MyBatis Spring, you no longer need to directly use SqlSessionFactory, because your bean can be injected into a ...

Posted by graziano on Sat, 15 Jan 2022 16:33:16 +0100

SpringBoot advanced usage

1, SpringBoot advanced usage 1. Lombok plugin 1.1) Maven coordinate query website: https://mvnrepository.com/ You can now find information about the maven package 1.2) add jar package file <!--add to lombok rely on--> <dependency> <groupId>org.projectlombok</groupId> <artifactId&g ...

Posted by atulkul on Sat, 15 Jan 2022 06:02:08 +0100