【发布时间】:2012-09-18 09:27:50
【问题描述】:
我有两个域对象
Class Attachment{
static hasMany = [mailDrafts: MailDraft];
}
Class MailDraft{
static hasMany = [attachments: Attachment]
static belongsTo = Attachment
}
它已经创建了三个表
1)attachment
2)mail_draft
3)attachment_mail_drafts
attachment_mail_drafts: id, mail_draft_id
现在,我想写一个 HQL 查询to delete an entry from the table 'attachment_mail_drafts' where 'attachment_id' is 4,那么查询是什么。
【问题讨论】:
标签: grails many-to-many hql grails-orm grails-2.0