Several ways of SpringBoot+Mybatis registration using Mapper interface

  • 2021-10-27 07:09:48
  • OfStack

Directory I. Environment preparation
1. Database preparation
2. Project environment
II. Example demonstration
1. Entity class, Mapper class
2. Registration method
2.1 @ MapperScan registration method
2.2 @ Mapper registration method
2.3 MapperScannerConfigurer registration method
3. Summary
III. Can't miss the source code and related knowledge points

The SpringBoot project uses Mybatis to operate the database, which is no stranger to most small partners of java technology stack; As we know, with mybatis, 1 will have the following

Entity: Database Entity Class Mapper: db Operating Interface Service: Service class xml file: Where to write sql

This blog post mainly introduces several gestures of how the Mapper interface is associated with the corresponding xml file (this problem is like "anise". There are several ways to write


Related articles: