There is a domain class with field id
being injected by Grails. Instantiating such a class with a map results in id == null
:
def obj = DomainClass.class.newInstance(id:100, name:'Joe')
assert obj.id != null // it fails
What is the best practice to assign all the hidden properties in Grails?