Using assigned ID for domain object in Grails 2.0
问题 We are using Grails with a legacy database and we need to control how ID's get assigned to domain objects. We have tried: id column: "sco_id", generator:'assigned' but we get the exception: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 we have also tried to create a custom ID generator: public class ScoIdGenerator implements IdentifierGenerator { public Serializable generate(SessionImplementor session, Object object) { /*Generate ID here*/ return