Hello all,
I am using Toplink/JPA in my application and have had great success with it previously. The problem I am running into here seems quite odd. I have an annotated pojo similar to the following as the parent class:
public class ParentClass {
@Column(name = "multiple")
protected int multiple = 1;
@Column(name = "description")
protected String description;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "myParent")
protected List<Child> answers = new ArrayList<Child>();
/*
* necessary getters and setters below
*/
...
}
and an other as the child class:
public class Child {
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "entry_id")
private ScorecardEntry myEntry;
}
The problem is that when I change the parent class by changing multiple and/or description as well as add new (unmanaged/unpersisted) Child objects to the collection and do a em.merge(parent); all of the children are being persisted but the parent objects fields are not. I sure I am doing something wrong and that is the cause but I can't seem to figure out what it is. Any information that can be provided is greatly appreciated in advance.
Thanks,
Justen L. Britain