Hello,
I have two entities PARENT & CHILD defined below.
I try to reset the Parent.children list, or remove the parent entity, but
nothing happen in database for my children (I cant get my children anymore
from Java code (parent.getChildren()), but they are still present in
database even after a commit operation).
Any idea? It sounds like a OpenJPA issue for me.
Thanks a lot for our help. Regards,
Nicolas
P.S. Tried with openjpa 1.0.3 & 1.1.0
@Entity
@Table(name = "PARENT")
public class Parent {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
private long id;
@Version
@Column(name = "VERSION")
private int version;
@Basic
@Column(name = "NAME")
private String name;
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy =
"parent")
@OrderBy(value = "ordr")
private List<Child> children = new ArrayList<Child>();
}
@Entity
@Table(name = "CHILD")
public class Child {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
private long id;
@Version
@Column(name = "VERSION")
private int version;
@Basic
@Column(name = "ORDR")
private int ordr;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "PARENT_ID", nullable = false)
private Parent parent;
@Basic
@Column(name = "NAME")
private String name;
}
--
View this message in context:
http://n2.nabble.com/Cascade-Delete-Issue--tp675459p675459.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.