在grails文档中,http://grails.org/doc/latest/guide/GORM.html#cascades
对于单向一对一映射,
In the case of a unidirectional one-to-one association that defines a belongsTo then the cascade strategy is set to "ALL" for the owning side of the relationship (A->B) and "NONE" from the side that defines the belongsTo (B->A)
我理解这一点,但是只是想知道外键在哪里,是在拥有方还是另一方?
谢谢。
最佳答案
在属属(B-> A)的情况下,外键作为a_id保留在B上。
关于grails - grails用于单向一对一的外键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20048337/