I'm going nuts with foreign key constraints here. No matter what I specify for cascading behavior or belongsTo/hasMany
, I get a foreign-key constraint error
I have this:
class A{
}
class B{
}
class C extends B {
st开发者_JAVA技巧atic belongsTo = [a: A]
}
I want to run A.list()*.delete()
What do I need to do to get C
to cascade delete with A
?
Have you added mappings in class A
?
class A{
static hasMany=[c:C]
static mappedBy=[c:"cColumn"]
}
As I understand from this, both mappings should be present
精彩评论