Uploaded image for project: 'OSAMES ORM'
  1. OSAMES ORM
  2. ORM-110

Préciser les PK et les FK dans le mapping

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.1.0
    • Fix Version/s: 0.3.0
    • Component/s: None
    • Labels:
      None

      Description

      Contexte

      Idée

      enregistrer tout un graphe d'objets parent-enfant en une seule passe, en sauvant le parent, récupérant la PK, l'injectant dans l'enfant...

      Proposition

      on pourrais ajouter une section <key>. Du coup la première de la section serait forcément la primary et toute les suivantes des foreign key.

      <orm:Table name="Customer">
        <!-- Unique key -->
        <orm:MappingObject property="CustomerId" column="CustomerId"/>
        <orm:MappingObject property="FirstName" column="FirstName"/>
        <orm:MappingObject property="LastName" column="LastName"/>
        <orm:MappingObject property="Company" column="Company"/>
        <orm:MappingObject property="Address" column="Address"/>
        <orm:MappingObject property="City" column="City"/>
        <orm:MappingObject property="State" column="State"/>
        <orm:MappingObject property="Country" column="Country"/>
        <orm:MappingObject property="PostalCode" column="PostalCode"/>
        <orm:MappingObject property="Phone" column="Phone"/>
        <orm:MappingObject property="Fax" column="Fax"/>
        <orm:MappingObject property="Email" column="Email"/>
        <orm:MappingObject property="SupportRepId" column="SupportRepId"/>
        <orm:keys>
             <orm:key column name="CustomerId" />
        </orm:keys>
      </orm:Table>
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              babs Barbara Post
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: