Does Grails have a “property” reserved word?

Does Grails have a “property” reserved word? That is, is it possible to name a domain class Property, and its owner refers to properties? Example:

class Thing {
    static hasMany = [properties: Property]
}

class Property {
    static belongsTo = [thing: Thing]
}

When I try to add Propertyin Thing, I get an error:

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)

Is there a list of all Grails reserved words?

+3
source share
3 answers

I'm not sure what is Propertyreserved, but propertieshandled specifically for domain classes, as it is used for data binding . What happens when you change:

static hasMany = [properties: Property]

to something like

static hasMany = [myProperties: Property]
+3
source

Grails - -. , . Groovy Java, . .

, "", , , , /, Groovy . , ?

0

Property grails, - , ?

, - BlahProperty?

-1

Source: https://habr.com/ru/post/1718868/


All Articles