Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Cascade REMOVE


I'm running into another problem with EclipseLink in Glassfish - when I delete an Entity that has a collection defined with a OneToMany relationship, cascade REMOVE doesn't seem to be working. The delete throws a foreign key violation error because the dependent entity is not deleted. Here is a code snippet:

@Entity
public class Study implements java.io.Serializable {
...
@OneToMany(mappedBy="study", cascade={CascadeType.REMOVE, CascadeType.MERGE, CascadeType.PERSIST})
   private java.util.List<StudyAuthor> studyAuthors;
...
}

@Entity
public class StudyAuthor implements java.io.Serializable {
...
   @ManyToOne
   private Study study;
...
}

This same code is working when I use TopLink Essentials. Before entering a bug I just wanted to check if there is some configuration issue that may be causing this.
Thanks,
Ellen


Back to the top