-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Lists not linked to primary key of parent
PostPosted: Tue May 22, 2007 12:27 pm 
Newbie

Joined: Fri Oct 29, 2004 9:39 am
Posts: 5
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.

_________________
Chris


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.