Loading ...
Sorry, an error occurred while loading the content.

Re: [xml-dbms] Child Parent relationship - Question

Expand Messages
  • rpbourret@rpbourret.com
    Is this question solved by my answer to your previous question? If not: 1) What do you mean by My problem is that I am unable to map the relationship as to
    Message 1 of 2 , Dec 24, 2002
    • 0 Attachment
      Is this question solved by my answer to your previous question? If not:

      1) What do you mean by "My problem is that I am unable to map the relationship
      as to related class map without removing foreign key(2)." ? Does this mean you
      have to remove foreign key (2) to map the class? Or that you must have FK (2)?

      2) What is the point of FK (1)? It doesn't make sense to me that this should be
      both the primary key and a foreign key.

      3) Why is <parentActivity> a child of <activity>? If you nest elements -- that
      is, <activity> has <activity> children -- then the <dataKey> element in the
      parent <activity> element will provide this information for its child
      <activity> elements. Having <parentActivity> in the child means that the data
      is redundant -- it occurs in both the parent and the child.

      -- Ron

      > My XML document is as follows:
      >
      > <activity>
      > <dr:dataKey>
      > <dr:recordId>2</dr:recordId>
      > <dr:applicationId>child</dr:applicationId>
      > </dr:dataKey>
      > <parentActivity>
      > <dr:recordId>2</dr:recordId>
      > <dr:applicationId>parent</dr:applicationId>
      > </parentActivity>
      > ...............
      > ...............
      > ...............
      > </activity>
      >
      > The two tables I would like to be able to map these elements to are
      >
      > Activity(recordId,applicationId)
      > primary key - recordId,applicationId
      >
      >
      > SubActivities
      > (childRecordId,childApplicationId,parentRecordId,parentApplicationId)
      > primary key - childRecordId,childApplicationId
      >
      > foreign key(1) - childRecordId,childApplicationId references
      > Activity(recordId,applicationId)
      >
      > foreign key (2)- parentRecordId,parentApplicationId references
      > Activity(recordId,applicationId)
      >
      > My problem is that I am unable to map the relationship as to related
      > class map without removing foreign key(2).
      >
      > I would like to be able to map <parentActivity> to the Activity class
      > and as a related class to the subActivities table.Any
      suggestions?
    Your message has been successfully submitted and would be delivered to recipients shortly.