Grails3.2+新增了一些新东西

记录一下一些坑html

Grails3.2-版能够直接在domain中注入service,在Grails3.2+中默认关闭了自动注入功能

开启方式

  • 方式一

application.groovy中配置全局映射,若没有此脚本需新建app

grails.gorm.default.mapping = {
    autowire true
}
复制代码
  • 方式二

在须要注入beandomain中添加映射dom

static mapping = {
    autowire true
}
复制代码
  • 方式三

application.yml中新增或修改配置spa

---
grails:
 gorm:
 autowire: true
复制代码

参考

相关文章
相关标签/搜索