我有一個域類如下
class Training{
// has one createdBy object references User domain and
// has one course object references Course domain
// has One Trainer1 and Trainer2 objects refernces Trainer Object.
}
class Trainer{
String name
//can have many trainings.
//If Trainer gets deleted, the trainings of him must be deleted
}
Class User{
String name
// can have many trainings.
}
class Course{
String name
//If Course gets deleted, Trainings of this course must be deleted
// can have many trainings.
}
我有一個訓練創建頁面,在那裏我有填充已保存的課程,用戶,培訓師1和培訓師2。創建訓練時,我不保存它們。
那麼,如何指定Grails的
加油吧。這是一個簡短的回答很好的問題。當你忘記關係定義並且只想簡短的片段時,它會很方便。 – MeIr 2012-11-15 11:25:04
@MeIr - 這是whaere文檔的基本定義派上用場。 – 2012-11-15 11:36:41
我同意你的意見。但是當我GOOGLE了它,stackoverflow第一次;) – MeIr 2012-11-15 21:59:54