简体   繁体   中英

Scaffold MySQL table with composite primary key in Grails

package website

class Translations {

    String content;

    /* Primary key consists of language_id and text_id */

    static constraints = {
        content();
    }

}

Everything is clear for tables with single primary keys.

But I wonder how to handle with composite keys.

Is it possible to scaffold those tables, using Grails 2.1.1?

It's directly supported, though there are some additional requirements for your domain class. See the GORM documentation at http://grails.org/doc/latest/guide/GORM.html#compositePrimaryKeys

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM