mybatis-plus. mapper-locations
时间: 2023-09-23 12:07:54 浏览: 61
MyBatis-Plus is an enhanced version of MyBatis, which is a popular Java persistence framework for working with SQL databases. It provides additional features and simplifies the development process.
The `mapper-locations` property in MyBatis-Plus is used to specify the XML mapper files location. These XML files contain the SQL statements and mapping configurations for MyBatis to interact with the database.
You can specify multiple locations using comma-separated values or use wildcards to scan for XML files in a directory. For example:
```properties
mybatis-plus.mapper-locations=classpath*:mapper/**/*.xml
```
This configuration will search for XML files in the `mapper` directory and its subdirectories on the classpath.
You can also specify file paths using the `file:` prefix. For example:
```properties
mybatis-plus.mapper-locations=file:/path/to/mapper/*.xml
```
This configuration will look for XML files in the specified directory on the file system.
Make sure to provide the correct location(s) of your mapper XML files so that MyBatis-Plus can find and parse them correctly.