mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-352: JOINED inheritance doesn't remove child object #434
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Feb 19, 2010).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user cloun:
I have a two class with joined inheritance:
I created PictureFile instance, added it to the Repository_Picture, flushed em. All worked fine. I saw in database one rows in the picture_ordered table and one in the picture_file table.
After that I tried to remove picture from Repository_Picture, and took the error: Integrity constraint violation
#0 E:...\library\Doctrine\DBAL\Connection.php(627): PDOStatement->execute(Array)
#1 E:...\library\Doctrine\DBAL\Connection.php(388): Doctrine\DBAL\Connection->executeUpdate('DELETE FROM pic...', Array)
#2 E:...\library\Doctrine\ORM\Persisters\JoinedSubclassPersister.php(283): Doctrine\DBAL\Connection->delete('picture_ordered', Array)
#3 E:...\library\Doctrine\ORM\UnitOfWork.php(785): Doctrine\ORM\Persisters\JoinedSubclassPersister->delete(Object(PictureFile))
#4 E:...\library\Doctrine\ORM\UnitOfWork.php(312): Doctrine\ORM\UnitOfWork->_executeDeletions(Object(Doctrine\ORM\Mapping\ClassMetadata))
#5 E:...\library\Doctrine\ORM\EntityManager.php(280): Doctrine\ORM\UnitOfWork->commit()
#6 E:...\application\models\Database.php(93): Doctrine\ORM\EntityManager->flush()
#7 E:...\tests\maksidom\PictureTest.php(28): Database::flush()
I think that problem is that Doctrine doesn't remove child (PictrueFile) object before removing parent (Pictrue) object.