diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
index 63ec1c45dff2dfaf02e4671dd6e80bf412adc20d..c052a65ea3794274a52cccaba91c4df4f049ae36 100644
--- a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
+++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
@@ -763,7 +763,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
         $dataMap = $this->dataMapper->getDataMap(get_class($parentObject));
         $columnMap = $dataMap->getColumnMap($propertyName);
         $parentUid = $parentObject->getUid();
-        if ($parentObject->_getProperty('_localizedUid') !== null) {
+        if (!empty($parentObject->_getProperty('_localizedUid'))) {
             $parentUid = $parentObject->_getProperty('_localizedUid');
         }
         $row = [
@@ -935,7 +935,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
         $row['uid'] = $object->getUid();
         if ($dataMap->getLanguageIdColumnName() !== null) {
             $row[$dataMap->getLanguageIdColumnName()] = (int)$object->_getProperty('_languageUid');
-            if ($object->_getProperty('_localizedUid') !== null) {
+            if (!empty($object->_getProperty('_localizedUid'))) {
                 $row['uid'] = $object->_getProperty('_localizedUid');
             }
         }
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
index 2e55f63235c65863c5cb427d0757c03304f97843..e6af94735df9a8e875d4043deef073f626489b08 100644
--- a/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
+++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
@@ -233,7 +233,7 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface
         $dataMap = $this->getDataMap($className);
         $object->_setProperty('uid', (int)$row['uid']);
         $object->_setProperty('pid', (int)$row['pid']);
-        $object->_setProperty('_localizedUid', (int)$row['uid']);
+        $object->_setProperty('_localizedUid', (int)$row[$dataMap->getTranslationOriginColumnName()]);
         $object->_setProperty('_versionedUid', (int)$row['uid']);
         if ($dataMap->getLanguageIdColumnName() !== null) {
             $object->_setProperty('_languageUid', (int)$row[$dataMap->getLanguageIdColumnName()]);