如何更改Grails中的主键列? [英] How to change primary key column in grails?

查看:153
本文介绍了如何更改Grails中的主键列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有Integer变量'code'的域类。我的要求是为该域创建代码,主键列,并自动增加,并从为该doamin.thnks创建的表中删除默认的'id'列。

I have a domain class having an Integer variable 'code'. my requirement is to make 'code', primary key column for that domain and also auto increment and to remove the default 'id' column from the table created for that doamin.thnks



解决方案
use this :

'code'
}

更多信息在这里:
http://grails.org/doc/2.0.x/ref/Database%20Mapping/ id.html

这篇关于如何更改Grails中的主键列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆