There are many similar questions, but I have not been able to determine exactly how to use the POJO model in the grails application. Consider the following Java Bean:
package com.example.java; public class UserBean { String name; String surname; Integer age;
and grails domain class:
package com.example.grails class User extends com.example.java.UserBean { static constraints = { name(blank:false) surname() age() } }
and a companion controller with scaffold = true. I am not sure if this should work, but I have not seen anything that would indicate otherwise. This compiles and runs fine until I try to add a new user from the generated view. Then i get
org.hibernate.MappingException: Unknown entity: com.example.grails.User
Any ideas?
source share