Reputation: 1293
I found the following Groovy code. Does anyone knows what it does mean the rows column
notation? How can I make use of the "mapping"?
class TextAreaView {
Integer rows
Integer cols
static mapping = {
rows column: "rows_size"
cols column: "cols_size"
}
}
Thanks!
Upvotes: 1
Views: 243
Reputation: 171114
That's a grails domain class mapped onto custom fields in the database.
See http://grails.org/doc/latest/guide/GORM.html#tableAndColumnNames
You don't use it directly.
The format is basically passing a map to a method.
If you add parentheses, it would look like:
rows( [ column:'rows_size' ] )
Upvotes: 3