DDC-409: Mapping onDelete="CASCADE" and onUpdate="CASCADE" from annotation file to YAML and XML #4898

Closed
doctrinebot opened this Issue Mar 11, 2010 · 5 comments

2 participants

@doctrinebot

Jira issue originally created by user freeakk:

    /****
     * @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

@doctrinebot

Comment created by @beberlei:

fixed format

@doctrinebot

Comment created by @beberlei:

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

@doctrinebot

Comment created by freeakk:

Yes

@doctrinebot

Comment created by @beberlei:

Updated

@doctrinebot

Issue was closed with resolution "Fixed"

@jwage jwage was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.0-BETA1 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment