MyBatis - use of basic annotations

0. Project construction Still the same, let's build a new project first   mybatis-04-annotation  , Copy and paste all the files from the previous project and simplify them. Streamlined code, just streamline it   mybatis-config.xml   You can: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration ...

Posted by Forever_xxl on Sat, 20 Nov 2021 18:41:11 -0800

MyBatis - loading mechanism for global configuration files

For code debugging, we can use any test code in the previous chapter as the Debug carrier. In this chapter, we actually study these two codes: InputStream xml = Resources.getResourceAsStream("mybatis-config.xml"); SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(xml); That is, how to load the MyBatis global ...

Posted by BETA on Sat, 20 Nov 2021 15:46:12 -0800

Mybatis - the first mybatis program

MyBatis If there is a problem, switch the version: jdk:1.8mysql:5.1.47maven 3.6.1IDEA brief introduction What is MyBatis MyBatis is an excellent persistence layer framework, which supports custom SQL, stored procedures and advanced mapping. MyBatis eliminates almost all JDBC code and the work of setting parameters and obtaining result ...

Posted by watts on Sat, 20 Nov 2021 13:06:01 -0800

Mybatis LUS code generator and some optimizations

To use the mybatis plus code generator, you must first add dependencies (also known as import packages), and import packages according to the official website recommendations and project requirements Official website link: https://mp.baomidou.com/guide/ 1. Add code generator dependency <dependency> <groupId>com.baomidou&lt ...

Posted by fean0r on Sat, 20 Nov 2021 05:35:54 -0800

MyBatis - mapper mapping file details

0. Project construction As usual, let's build a new project first   configuration   The project is a little messy. The name of the project is what we call it   mybatis-03-mapper   Well, the imported dependencies are the same as before, and then simplify the previous code. The copied project structure and documents shall be ...

Posted by s1yman on Fri, 19 Nov 2021 16:53:02 -0800

Mybatis plus upgrade complete! What has my system been updated? What's better about mybatis plus than mybatis?

Mybatis plus upgrade complete! What has my system been updated? What's better about mybatis plus than mybatis? I've been writing about the system for nearly a month. Generally speaking, I upgraded my Mybatis to Mybatis plus, but it's not exactly like this. There are many small changes. This time, I specially wrote a blog to record the update ...

Posted by JParishy on Thu, 18 Nov 2021 20:25:28 -0800

Mybatis learning notes - dynamic sql

Dynamic sql Dynamic SQL is one of the powerful features of MyBatis. Using dynamic SQL, we can flexibly splice SQL statements according to different conditions. Common dynamic SQL tags are as follows: ifchoose(when,otherwise)trim(where,set)foreach if When < if > sql < / if > is used, if the conditions are met, the SQL will ...

Posted by rivka on Thu, 18 Nov 2021 17:20:57 -0800

Mybatis plus from entry to mastery (all)

preface When learning mybatis plus Need to master some knowledge points Zero foundation of java from entry to mastery (all) 200000 word summary of javaSE from entry to mastery (I)200000 word summary of javaSE from entry to mastery (2)200000 word summary of javaSE from entry to mastery (3) as well as Spring framework from introduction to ...

Posted by evan12 on Thu, 18 Nov 2021 02:11:59 -0800

Understand the common configuration notes of Mybatis - Advanced

to configure 3.1. Core configuration file The MyBatis configuration file contains settings and attribute information that deeply affect MyBatis behavior. The top-level structure of the configuration document is as follows: configuration properties settings typeAliases typeHandlers objectFactory (object factory) plugins environment ...

Posted by Rohan Hill on Fri, 12 Nov 2021 18:18:23 -0800

One-to-many relationship processing in Mybatis basic learning

Preface: Hello, ladies and gentlemen, I'm running like a snail rz. Of course you can call me Snail Jun. I'm a beginner who has studied Java for more than half a year. At the same time, I have a great dream that I will become an excellent Java architect one day. This Mybatis Basic Learning series is used to record the whole process of ...

Posted by ataylor20 on Fri, 12 Nov 2021 13:55:50 -0800