[Mybatis beginners’ lecture from 0 to 90%] 17: Does Mybatis Mapper XML have to have the same name as the package? Detailed explanation of 4 ways to configure mappers

CSDN achieves 100 million technical people


Preface

For Mybatis Mapper, usually the Java interface and Mapper.xml are in the same package and have the same name, then Do they have tohave the same package name?

In fact, it is not necessary. For the configuration of Mapper, it isGlobal configuration filemybatis-config.xml passedmapperstag configuration, the following 4 configuration methods are provided! Attached at the endSource code verificationscreenshot!


1. Package method

highest priority

mybatis-config.xml

Guess you like

Origin blog.csdn.net/scm_2008/article/details/134232786