diff --git a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php index 684d30571..1fce9c701 100644 --- a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php +++ b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php @@ -181,6 +181,10 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister $id = $this->em->getUnitOfWork()->getEntityIdentifier($entity); } + if ($this->class->isVersioned) { + $this->assignDefaultVersionValue($entity, $id); + } + // Execute inserts on subtables. // The order doesn't matter because all child tables link to the root table via FK. foreach ($subTableStmts as $tableName => $stmt) { @@ -212,10 +216,6 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister $stmt->closeCursor(); } - if ($this->class->isVersioned) { - $this->assignDefaultVersionValue($entity, $id); - } - $this->queuedInserts = array(); return $postInsertIds;