记录一下一些坑
Grails3.2-版可以直接在domain中注入service,在Grails3.2+中默认关闭了自动注入功能
开启方式
- 方式一
在
application.groovy中配置全局映射,若没有此脚本需新建
grails.gorm.default.mapping = {
autowire true
}
- 方式二
在需要注入
bean的domain中添加映射
static mapping = {
autowire true
}
- 方式三
在
application.yml中新增或修改配置
---
grails:
gorm:
autowire: true