1. Restart idea or uninstall and reinstall Mybatis plug-in (no more words)
2. Check whether the file names of the .xml file and .java (the file suffix Idea may be hidden) are the same (same name)
Example: If the mapper is TestMapper(.java), then .xml should be
3. Check whether the package name under resources is the same as the package name of XXXMapper (.java) in the java directory (same package)
Example: If TestMapper is located/src/main/java/xxx/yyy/mapper/, it should be located at/src/resources/java/xxx/yyy/mapper。
(Note: idea may display xxx/yyy/ as. To avoid confusion between folders with /names, please open Explorer to view)
4. Fill in the basic structure in the .xml file and improve namespace
1. Fill in the dtd constraint (can also be obtained from the official website)
<!-- dtdconstraint --> <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-////DTD Mapper 3.0//EN" "/dtd/">
2. Namespace is the full package name of the mapper file
Example: If TestMapper is located/src/main/java/xxx/yyy/mapper/, then namespace should be.
<mapper namespace=""> </mapper>
This is the article about solving the problem of the Idea plug-in MybatisX failure. For more related content on Idea MybatisX failure, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!