Mybatis loading configuration files (two methods)
I Load using maperlocations of sqlsessionfactory,
This method can use wildcards, specify locations, and use multiple locations,
II Scanning with mappercannerconfigurer
This method can scan the interfaces under the specified package. If the configuration file needs to be scanned, the configuration file must be in the same directory as the corresponding Dao interface, and the name must be the same
III Configure mapper for mybatis
The first two are configured in the spring configuration file, and the < mappers > node is configured in the mybatis configuration file
PS: now let's introduce two ways for mybatis to load configuration files
summary
The above is the mybatis loading configuration file method (two methods) introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!