'Grails 4 Mapping exception - org.grails.datastore.mapping.model.IllegalMappingException: Non-existent mapping property
I am upgrading from grails 2.5.4 to 4 and getting the following error in grails 4 : Failed to instantiate [org.grails.orm.hibernate.HibernateDatastore]: Constructor threw exception; nested exception is org.grails.datastore.mapping.model.IllegalMappingException: Non-existent mapping property [parent] specified for property [children] in class [Domain]
The class and interface are :
class Domain implements Domainable, Serializable {
String name
Domain parent
static hasMany = [
children : Domain
]
static mappedBy = [
children: 'parent'
]
}
interface Domainable {
public Domainable getParent()
}
when getter method in interface is removed, it works fine, but with the getter method in interface, it gives the above error. It was working fine in grails 2.5.4
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|