diff --git a/src/Persisters/Entity/BasicEntityPersister.php b/src/Persisters/Entity/BasicEntityPersister.php index 377e03ce274..cd0d14984fa 100644 --- a/src/Persisters/Entity/BasicEntityPersister.php +++ b/src/Persisters/Entity/BasicEntityPersister.php @@ -1964,8 +1964,14 @@ private function getIndividualValue(mixed $value): array return $newValue; } + + $singleIdentifierValue = $this->em->getUnitOfWork()->getSingleIdentifierValue($value); + $identifier = $class->getIdentifier()[0]; - return [$this->em->getUnitOfWork()->getSingleIdentifierValue($value)]; + $singleIdentifierValue = Type::getType($class->fieldMappings[$identifier]->type) + ->convertToDatabaseValue($singleIdentifierValue,$this->platform); + + return [$singleIdentifierValue];; } public function exists(object $entity, Criteria|null $extraConditions = null): bool