If you have a Domain class with an assigned id (not the default autoincremented long), the id assignment must not be in the constructor, but in a different line.
That means, having this domain:
class State implements Serializable {
String id
static mapping = {
id column: 'id', generator: 'assigned'
}