I'm having trouble getting items in a list to link back to their parent properly. Here's my code:
Hibernate version: 3.2
Name and version of the database you are using: Oracle 10g
Mapping documents:
Code:
<class name="Workflow" table="workflows">
<id name="id" column="id">
<generator class="sequence">
<param name="sequence">workflow_seq</param>
</generator>
</id>
<list name="inputDatas">
WHAT GOES HERE?
<list-index column="data_index"/>
<one-to-many class="WorkflowData"/>
</list>
<list name="outputDatas">
WHAT GOES HERE?
<list-index column="data_index"/>
<one-to-many class="WorkflowData"/>
</list>
</class>
<class name="WorkflowData" table="workflow_data">
<id name="id" column="id">
<generator class="sequence">
<param name="sequence">workflow_data_seq</param>
</generator>
</id>
WHAT GOES HERE?
</class>
Table structure:Code:
workflows
id number
input_data_id number
output_data_id number
workflow_data
id number
data_index number
data varchar2(4000)
Classes:Code:
public class Workflow {
private Long id;
private List<WorkflowData> inputDatas;
private List<WorkflowData> outputDatas;
}
publc class WorkflowData {
private Long id;
private String data;
}
Where I have written "WHAT GOES HERE?" are the problem areas (and maybe you can see more!). How do I get the WorkflowData items to link back to the input_data_id and output_data_id columns instead of the id column of Workflow?
Thanks.