Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Flush could delete entities before inserting new ones #5742

@MacDada

Description

@MacDada

I have a unique (not PK) column. I need to remove old entities first and then add new ones (replacements).

Yeah, I've seen this: #5368

But I've also seen a "could be done" solution:

A function "setShouldPerformDeletesFirst" as described in http://docs.oracle.com/cd/B31017_01/web.1013/b28218/uowadv.htm#i1137484 would be very useful in those cases.

What I propose, is that this gets implemented. From the dev point of view, it would be cool, if one could do that like this:

* @ORM\OneToMany(targetEntity="Whatever", mappedBy="Me", cascade={"persist"}, orphanRemoval=true, removeBeforeAdd=true)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions