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

Closed
opened 2026-01-22 12:40:46 +01:00 by admin · 5 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 11, 2010).

Originally assigned to: @jwage on GitHub.

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

Originally created by @doctrinebot on GitHub (Mar 11, 2010). Originally assigned to: @jwage on GitHub. 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
admin added the Bug label 2026-01-22 12:40:46 +01:00
admin closed this issue 2026-01-22 12:40:46 +01:00
Author
Owner

@doctrinebot commented on GitHub (Mar 11, 2010):

Comment created by @beberlei:

fixed format

@doctrinebot commented on GitHub (Mar 11, 2010): Comment created by @beberlei: fixed format
Author
Owner

@doctrinebot commented on GitHub (Mar 11, 2010):

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 commented on GitHub (Mar 11, 2010): 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?
Author
Owner

@doctrinebot commented on GitHub (Mar 12, 2010):

Comment created by freeakk:

Yes

@doctrinebot commented on GitHub (Mar 12, 2010): Comment created by freeakk: Yes
Author
Owner

@doctrinebot commented on GitHub (Mar 12, 2010):

Comment created by @beberlei:

Updated

@doctrinebot commented on GitHub (Mar 12, 2010): Comment created by @beberlei: Updated
Author
Owner

@doctrinebot commented on GitHub (Mar 17, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Mar 17, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#505