Mybatis Generator: What's the best way to separate out “auto generated” and “hand edited files”

前端 未结 4 966
终归单人心
终归单人心 2020-12-22 23:32

I am on a project that uses both Mybatis (for persisting java to database) and Mybatis Generator (to automatically generate the mapper xml files and java i

4条回答
  •  梦毁少年i
    2020-12-22 23:44

    I had this task in Spring Boot project and was resolved bellow

    In mybatis/*.xml files i changed generated like this to But all sql logic must be written in xml-files. Interfaces are only declarations without @Select or @ResultMap annotations, so you must configure correctly your mybatis-generator.

    in application.properties i have

    mybatis.mapper-locations=classpath*:mybatis/*.xml mybatis.type-aliases-package=news.project.demo.models

提交回复
热议问题