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

后端 未结 5 1949
孤城傲影
孤城傲影 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条回答
  •  Happy的楠姐
    2021-02-06 05:45

    Yes in Oracle you can use ROWID for ID column.

    class Document {
        String id
    
        static mapping = {
            table "DOCUMENTS"
            version false
            id column: 'ROWID'
        }
    
    }
    

提交回复
热议问题