Disable the natively generated identity value feature in grails
问题 The following is my Domain class details. class Age { String agetype static constraints = { } } I am using HeidiSQL. I want to drop the id column that is generated automatically.And set primary key as 'agetype'. what I can I do? 回答1: Identifier can be customized easily inside the mapping block, if the default id is not required. class Age { String agetype static mapping = { id name: 'agetype', column: 'AGE_TYPE', // if the column name is AGE_TYPE generator: 'assigned' // Unique String should