When working with Propel, I've ran into the following issue:
I have a data model that uses an object as a master (primary entry point) and multiple objects linked to that in either one-to-one or one-to-many relationships. My goal was to replicate the master as a new record, which should also simultaneously replicate the related objects. Via deep copy, this works fine for one-to-many relationships. However, not for one-to-one.
When performing a deep copy on a one-to-one relationship, it looks like rather than the two new objects referencing one-another after being created, a third entry is added which the second object references, rather than the desired first object.
In terms of the Bookstore test case; if I had a BookstoreEmployee and BookstoreEmployeeAccount and did a deep copy on BookstoreEmployee, it would create two new BookstoreEmployee entries, the first of which being our desired copy, and the second being an additional copy that the new BookstoreEmployeeAccount is referencing instead of the desired copy.
I've added a gist of my test case for this. I won't rule out an issue with my implementation, but this doesn't seem like expected behavior.
Adding unit test for one-to-one relationship deep copy bug (Propel Is…