EJB: How to delete child entries from a parent-child CMR one-to-many relationship?

Discussion in 'Java' started by davout, Apr 18, 2004.

  1. davout

    davout Guest

    In situation where a parent entity has a one-to-many CMP/CMR relationship to
    a child entity, is there a quick way to delete all child entity data
    instances without deleting the parent entity?

    I thought I read somewhere that you could use the parent entity field
    representing the child entity container method and call its 'clear' method
    but this doesn't seem to work.

    Also I've tried retrieving the child list collection and then using an
    iterator to find the child entity instnces and call the child entity remove
    method. But this seemed to cause problems for subsequent calls to the parent
    entity child lost collection field.

    Any ideas?
    davout, Apr 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marco Ippolito
    Replies:
    0
    Views:
    2,563
    Marco Ippolito
    Oct 11, 2004
  2. Patrick Maddox
    Replies:
    0
    Views:
    980
    Patrick Maddox
    Aug 1, 2003
  3. Mirko
    Replies:
    0
    Views:
    2,288
    Mirko
    Oct 12, 2006
  4. Raymond Schanks
    Replies:
    0
    Views:
    640
    Raymond Schanks
    Aug 3, 2010
  5. Jim Thomason
    Replies:
    3
    Views:
    151
    Topmind
    Oct 2, 2004
Loading...

Share This Page