Gatusko Gatusko - 1 month ago 3x
Java Question

Is there any method like orphanRemoval of JPA in JDO with Kodo?

Right now I'm using Kodo 4.1 with JDO and I see a lot of orphans in a lot of tables. I worked before with JPA and I solved a similar issue of orphans with orphanRemoval, but I can't fin a method like that in JDO. I can see the warn in my log, but nothing more and the warn is for the Kodo Properties.


JDO has the attribute dependent that you can specify on a field, or on a collection element, or map key/value, or array element. This is effectively cascade delete + remove orphans.

Kodo never fully implemented JDO 2.0 IIRC (and certainly never obtained compliance), and so maybe didn't implement this part of it. Maybe it had some vendor extension somewhere that does it (just not the standard route), but it is a dead project either way.

DataNucleus JDO fully implements JDO 2.0, 2.1, 2.2, 3.0, 3.1 and 3.2 and is compliant, providing this functionality.