openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: Forcing an Object to be always inserted/updated first during persist/merge
Date Tue, 04 May 2010 22:22:52 GMT

  Did you try orphan deleting from the leaf?

  Say A has many B and B has many C and C has many D

  Then some thing like this in

   @OneToMany(...., orphanDelete=true)
   List bs;
   void deleteChildren() {
      for (B b : bs) b.deleteChildren();
      bs = null;

   And in

   @OneToMany(...., orphanDelete=true)
   List<C> cs;
   void deleteChildren() {
      for (C c : cs) c.deleteChildren();
      cs = null;

And then at the application level,

   A a = ...;


View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message