@OneToMany - delete does not work
561600Feb 13 2007 — edited Oct 27 2008hi,
I'm using Spring version 2.0.1 and Toplink essentials, and am encountering the following problem: in a OneToMany relationship, items that are deleted from the list are deleted from the cache but not from the database.
example tables:
TABLE_PARENT, PK=PARENT_ID
TABLE_CHILDREN, PK=CHILD_ID, FK TO TABLE_PARENT.PARENT_ID
example mappings:
@Entity
@Table(name="TABLE_PARENT")
public class Parent
{ ...
@OneToMany(cascade=CascadeType.ALL, mappedBy="m_parent",fetch = FetchType.EAGER)
private List<Child> m_childList = new ArrayList<Child>();
}
@Entity
@Table(name="TABLE_CHILD")
public class Child
{ ...
@ManyToOne(optional = false)
@JoinColumn(name="PARENT_ID")
private Parent m_parent;
}
Thanks,
yasmin