grails - GORM abstract domain class -
i have 2 abstract grails domain classes like
abstract class { static hasmany = [ b : b ] static mapping = { tableperhierarchy false } } class achild extends { } abstract class b { static belongsto = static mapping = { tableperhierarchy false } } class bchild extends b { }
i have code does
a = new achild() a.b << new bchild() a.save(flush:true)
this works expected
now, when try do
b.delete(flush:true)
this fails because of referential integrity violation in join table created between a/b. looks first query gorm part of delete delete b
table, not join table, , join has reference b
table id, causes violation.
delete b id=? , version=?
the reason keep a
, b
in domain folder can things a.list()
, moving out src/groovy
last option.
i think bug in gorm abstract classes. have opened issue https://github.com/grails/grails-core/issues/593
Comments
Post a Comment