具体报错
For “${…}” content: Expected a string or something automatically convertible to string (number, date or boolean), or “template output” , but this has evaluated to an extended_hash (wrapper: f.t.SimpleHash):
翻译的意思是:
“${… }”的内容:期望一个字符串或自动转换为字符串的东西(数字、日期或布尔值),或“模板输出”,但这已经被评估为一个extended_hash(包装器:f.t.SimpleHash):
大概意思:
就是说找不到${} 中的这个变量 ,如下图中的 ${package}是不存在的,所以就会报这个错。

问题解决
可以找一些别人正确的模板看看,我这个模板里面的变量之前是手动传入的,所以mybatis-plus-generator中没有这个变量,导致赋值失败。
举例:${package}改成 ${package.Service}等 就行。

具体mapper、entity、service、serviceImpl的模板文件看另一个博客。

本文介绍了一个关于MyBatis Plus生成器中的模板变量错误,并提供了详细的解决方案。主要针对无法正确解析模板中的${...}
8091

被折叠的 条评论
为什么被折叠?



