CascadeType « JPA « Spring Q&A





1. CascadeType.Persist does not work as expected    stackoverflow.com

I have the following code (simplified of course):

 @Entity
 public class Foo {
   @Generated
   private Long id;
   @OneToMany(mappedBy=foo)
   @Cascade(CascadeType.PERSIST)
   private Collection<Bar> ...

2. Using CascadeType in Hibernate    stackoverflow.com

I m working with Hibernate + Spring and JSF I have a problem when I use a relationship like @OneTomany in Hibernate. For example:

@Entity
@Table(name = "book")
public class Book {

  ...

3. CascadeType.ALL does not remove    forum.springsource.org

Hi all, I have two entities related to each other. a Tree entity Code: @Entity public class Tree { @Id private Long id; private String name; @OneToMany(cascade=CascadeType.ALL) private List leafs; } ...

4. How does CascadeType.All work under the covers    forum.springsource.org

How does CascadeType.All work under the covers I have a parent child relationship Parent Entity Child Entity, when I persist the child enity I wish to persist the parent. childEntity.persist() As ...