JPA - Removing entities

Posted by James P. on Stack Overflow See other posts from Stack Overflow or by James P.
Published on 2010-04-07T11:00:39Z Indexed on 2010/04/07 11:03 UTC
Read the original article Hit count: 333

Filed under:
|
|
|

I have a Story entity with the following associations:

  • Story <1-*> Chapter
  • Story <1-*> Comment
  • Story <*-1> User

What is the correct way of removing this entity and handling the all the entities that is referring to? Is there some shorthand way of specifying that associated entities must be handled automatically or is the @PreRemove annoation mentionned in the article below a valid of achieving this?

http://blog.xebia.com/2009/04/09/jpa-implementation-patterns-removing-entities/

© Stack Overflow or respective owner

Related posts about jpa

Related posts about remove