OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions ImportExport problem with duplicate creation on cascading persist

This topic contains 0 replies, has 1 voice, and was last updated by  marc.roberts 4 years, 9 months ago.

The forum will run in the read-only mode starting from March 1. Please head to StackOverflow for support.

  • Creator
    Topic
  • #33836

    marc.roberts
    Participant

    This is my first fore into OroPlatform so if the question seems confusing then let me know. I have simplified the case for ease of understanding.

    We have an implementation where the import export is being used to create data in the system from a file similar to:

    “make”,”model”,”fuel”
    “Audi”,”A3″,”diesel”
    “Audi”,”A4″,”petrol”
    “Toyota”,”Corolla”,”petrol”

    in our converter this is correctly converted to an entity (sudocode):

    Make {
    protected $id;
    protected $name; // unique
    }

    Vehicle {
    protected $id;
    protected $make; // Make Entity
    protected $model;
    protected $fuel;
    }

    with cascading persistence the import fails as the Make “Audi” in this case would be duplicate when inserting into the database.

    At the moment the check for an existing entity occurs in the AddOrReplaceStrategy. Is there a way to tell the import that the make name is unique and should be created only once?

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No