mybatis-plus-generator代码生成使用freemarker模板生成问题
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.Simp
具体报错
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的模板文件看另一个博客。

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐
所有评论(0)