读书人

多个domain其间有复杂关联关系

发布时间: 2012-09-05 15:19:34 作者: rapoo

多个domain之间有复杂关联关系
基本的定义方法看帮助文档就行了,但是有个地方把我弄糊涂了:

one-to-many需要:

static belongsTo=[publisher:Publisher]

many-to-many需要:
static belongsTo=Author


如果一个类要两个约束都写上,怎么写?其实两种方式是一样的,只是第一种相当与有个别名。那么就写成
static belongsTo=[publisher:Publisher, author:Author] 

或者
static belongsTo=[Publisher, Author]

读书人网 >网络基础

热点推荐