asked on
@Entity(name = "workflow_template")
public class WorkflowTemplate {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@OneToMany(cascade = {CascadeType.ALL})
@JoinColumn(name = "workflow_id")
@OrderColumn(name = "task_idx")
private List<TaskTemplate> taskTemplates;
-----
@Entity(name = "task_template")
public class TaskTemplate {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@ManyToOne
@JoinColumn(name = "workflow_id", nullable = false)
private WorkflowTemplate workflowTemplate;