Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-409

Mapping onDelete="CASCADE" and onUpdate="CASCADE" from annotation file to YAML and XML

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0-ALPHA4
    • Fix Version/s: 2.0-BETA1
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None

      Description

          /**
           * @ManyToOne(targetEntity="basicHost",  cascade={"all"}, fetch="EAGER")
           * @JoinColumn(name="host_id", referencedColumnName="id", onDelete="CASCADE", onUpdate="CASCADE", nullable=true)
           */
      

      onDelete="CASCADE" and onUpdate="CASCADE" don't exist in XML and YAML schemas, which are generated from annotation file...

      There are only:

              <one-to-one field="hostId" target-entity="basicHost" orphan-removal="">
                  <cascade>
                      <remove/>
                      <persist/>
                      <refresh/>
                      <merge/>
                      <detach/>
                  </cascade>
              </one-to-one>
      

      or this for yaml:

        oneToOne:
          hostId:
            targetEntity: basicHost
            cascade:
              remove: true
              persist: true
              refresh: true
              merge: true
              detach: true
            mappedBy: null
            joinColumns:
              host_id:
                referencedColumnName: id
            orphanRemoval: false
      

      But I need this:

        oneToOne:
          hostId:
            targetEntity: basicHost
            cascade:
              remove: true
              persist: true
              refresh: true
              merge: true
              detach: true
            mappedBy: null
            joinColumns:
              host_id:
                referencedColumnName: id
                onDelete: CASCADE
                onUpdate: CASCADE
            orphanRemoval: false
      

      onDelete and onUpdate exist on this page, but they don't work in annotation schema
      http://www.doctrine-project.org/documentation/manual/2_0/en/annotations-reference%3Areference%3A%40joincolumn

        Activity

        Hide
        Benjamin Eberlei added a comment -

        fixed format

        Show
        Benjamin Eberlei added a comment - fixed format
        Hide
        Benjamin Eberlei added a comment -

        Do in understand this issue right, when executing orm:convert-mapping from annotations to xml/yaml the onDelete and onUpdate get lost?

        Show
        Benjamin Eberlei added a comment - Do in understand this issue right, when executing orm:convert-mapping from annotations to xml/yaml the onDelete and onUpdate get lost?
        Hide
        Uvarov Michael added a comment -

        Yes

        Show
        Uvarov Michael added a comment - Yes
        Hide
        Benjamin Eberlei added a comment -

        Updated

        Show
        Benjamin Eberlei added a comment - Updated

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Uvarov Michael
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: