Having problems with domain class mappings. The domains are as follows:
User Domain
class User extends SecUser {
static hasMany = [ratings:Rating, searchedResults:Results, recommendedResults:Results]
static mappedBy = [searchedResults:"searched", recommendedResults:"recommended"]
}
Rating Domain
class Rating {
static belongsTo = User
Artist artist
double rating
}
Results Domain
class Results {
static belongsTo = User
def searched
def recommended
}
When compiling it gives following error:
Non-existent mapping property [recommended] specified for property [recommendedResults] in class [class ontourtest.User].
Any ideas why this is happening? Thanks very much!
Try changing the
def searchedanddef recommendedin theResultsclass to their actual types (exampleThing searched,Thing recommended). I’m not sure what type they’re supposed to be and i think grails doesn’t know either.See the documentation
Note: there is a type-o in the documentation 😉