macrozheng/mall-learning

PmsBrandMapper.xml 内容 overwrite 为何不是覆盖而是追加

lanyanguang32 opened this issue · 7 comments

这一节加了Swagger配置,重新生成PmsBrandMapper.xml里面的内容是追加的不是覆盖,编译一直报错,看了好久才发现。其他人有这个问题吗。

https://github.com/zwxbest/mybatis-generator-plugin 我用了这个插件,结果

<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.example.demo.mbg.model.PmsBrand">
    <result column="brand_story" jdbcType="LONGVARCHAR" property="brandStory" />
  </resultMap>

PmsBrandMapper.xml 中这一行还是会重复,还没有完全解决。

也遇到这个问题了,会在PmsBrandMapper.xml中追加一个resultMap,导致重复,编译失败

把现在项目已经生成的mapper文件和实体类删除后,运行Generator方法,The specified target project directory mall-tiny-01\src\main\resources does not exist
The specified target project directory mall-tiny-01\src\main\java does not exist
The specified target project directory mall-tiny-01\src\main\java does not exist
The specified target project directory mall-tiny-01\src\main\java does not exist

项目本身是可以跑通的 api数据也都可以访问到

mac和windows有些不一样
mac下路径是./src
windows 路径是.\src
需要注意下,如果路径不对的话会提示成功但没有没有生成的目录文件

解决了。。作者的应该是windows

The specified target project directory mall-tiny-01\src\main\java does not exist

Mybatis 这里注意路径,
(1)作者是在的mall-learing这个project下面,新建了 mall-tiny-01 子bundle,所以目录路径是: mall-tiny-01\src\main\java。如果自己每章节新建project,注意这里路径改为:src\main\java
(2)windows 路径为 \(或/) ,linux、mac更改路径符为 /