IDEA 不能正確識別 GORM 中的 mapping block 下的一些方法名,會報告錯誤,例如:
我們可以用 MappingBuilder 來解決這個問題,代碼如下:
import static grails.gorm.hibernate.mapping.MappingBuilder.*
。。。
static mapping = orm {
cache enabled: true
}
。。。
static final mapping = orm {
table "rq_feature"
version false
autoTimestamp false
property("bio", [type: "text"])
property("firstName", {
column([name: "fn"])
})
}
參考