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

1948Re: [xml-dbms] problem moving from table based mapping to object relational mapping

Expand Messages
  • Ronald Bourret
    Feb 1, 2002
      AffariMultilivello wrote:

      > Now I have to switch to object-relational mapping, so my SAMPLE.XML
      > has been modified and now has this structure:

      <snip text="xml document" />

      > I have consequently modified the SAMPLE_MAP.XML in this way

      <snip text="map document" />

      > but even if I try to add
      >
      > <RelatedClass KeyInParentTable="Candidate">
      > <ElementType Name="DATAW_MECC"/>
      > </RelatedClass>
      >
      > inside the 'DATAW_SEA CLASSMAP' it doesn't insert into DATAW_MECC
      >
      > Should I define a Foreign Key, or what else?

      Yes. You need to define both a candidate key and a foreign key.

      For example, your current tables are:

      "dataw_sea"
      -----------
      "nr_container", "azienda", "data"

      "dataw_mecc"
      ------------
      "codcliente", "data"

      If nr_container is the primary key of data_sea, then you need to add
      this to as a foreign key of dataw_mecc:

      "dataw_sea"
      -----------
      "nr_container", "azienda", "data"

      "dataw_mecc"
      ------------
      "nr_containerFK", "codcliente", "data"

      and specify it in the map:

      <RelatedClass KeyInParentTable="Candidate">
      <ElementType Name="DATAW_MECC"/>
      <CandidateKey>
      <Column Name="nr_container" />
      </CandidateKey>
      <ForeignKey>
      <Column Name="nr_containerFK" />
      </ForeignKey>
      </RelatedClass>

      > ....looking forward to insert 1.000.000records with XMLDBMS

      1.000.000 records! Let me know how it works.

      -- Ron
    • Show all 2 messages in this topic