在Grails中,屬性是一個保留字嗎?也就是說,我可以命名域名類別Property
,並且其擁有者通過properties
引用它嗎?例如:在Grails中,「屬性」是一個保留字嗎?
class Thing {
static hasMany = [properties: Property]
}
class Property {
static belongsTo = [thing: Thing]
}
當我嘗試添加Property
到Thing
我得到的錯誤:
Exception thrown: No signature of method: org.codehaus.groovy.grails.web.binding.DataBindingLazyMetaPropertyMap.add() is applicable for argument types: (Property) values: [Property : null]
groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.grails.web.binding.DataBindingLazyMetaPropertyMap.add() is applicable for argument types: (Property) values: [Property : null]
at ConsoleScript10.run(ConsoleScript10:3)
是否有保留字的Grails的名單?