Is it possible for a Grails Domain to have no 'id'?

后端 未结 5 1882
孤城傲影
孤城傲影 2021-02-06 05:32

Is it possible to create a table that has no \'id\'? For example, this is my domain:

class SnbrActVector {

    int nid
    String term
    double weight

    st         


        
5条回答
  •  梦如初夏
    2021-02-06 05:50

    You probably need to specify that nid is your id column.

    static mapping = {
        version false
        id generator: 'identity', column: 'nid'
    }
    

提交回复
热议问题