Problem:
if you create a new domain object and set its id in the constructor like this:
Cat catman = new Cat(id:1000, name: "catman", kind: "domestic short haired")
later, if you look at the object the id will be null. what gives?!
Solution:
Its madness, but it works to assign the id after the object is made. Just add
catman.setId(1000);
and you are in business.
Note: if you want to save the object into db after doing this, you must set the id generator to 'assigned'
if you create a new domain object and set its id in the constructor like this:
Cat catman = new Cat(id:1000, name: "catman", kind: "domestic short haired")
later, if you look at the object the id will be null. what gives?!
Solution:
Its madness, but it works to assign the id after the object is made. Just add
catman.setId(1000);
and you are in business.
Note: if you want to save the object into db after doing this, you must set the id generator to 'assigned'