我有两个域对象
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
,那么查询是什么。