Hello friends
I have an entity called workflow and another one called process.
The workflow has a collection of processes, it means a oneToMany relation,
and the process itself has a reference to workflow.
@Entity
public class Workflow implements Serializable{
private static final long serialVersionUID = -6940501155081900165L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
protected int id;
@Column(name = "NAME")
protected String name;
@OneToMany(mappedBy="workflow",cascade = {CascadeType.PERSIST,
CascadeType.MERGE, CascadeType.REMOVE}, fetch=FetchType.EAGER)
protected List<Process> processes;
public List<Process> getProcesses() {
return processes;
}
public void setProcesses(List<Process> processes) {
this.processes = processes;
}
}
@Entity
public class Process implements Serializable{
@ManyToOne(cascade = CascadeType.ALL)
Workflow workflow;
Other fields.........
}
The problem is how can I delete a process from a workflow assuming that the
workflow entity was already persisted in database.
Thanks in advence.
mlounnaci
--
View this message in context:
http://n2.nabble.com/entity-update-tp4534156p4534156.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.