src/app/n2n/impl/persistence/orm/property/relation/JoinColumnToOneRelation.php
public function supplyPersistAction(PersistAction $persistAction, $value, ValueHash $valueHash, 
				?ValueHash $oldValueHash) {
		if ($value === null) {
			$persistAction->getMeta()->setRawValue($this->entityModel, $this->joinColumnName, null);
			return;
		}
		
		$actionQueue = $persistAction->getActionQueue();
		$pdo = $actionQueue->getEntityManager()->getPdo();
		$targetPersistAction = $persistAction->getActionQueue()->getPersistAction($value);

		try {
			$targetPersistAction = $persistAction->getActionQueue()->getPersistAction($value);
		} catch (PersistenceOperationException $e) {
			throw new PersistenceOperationException($this->entityProperty->toPropertyString() . ' of entity obj '
				. EntityInfo::buildEntityString($persistAction->getEntityModel(), $persistAction->getId())
				. ' contains value that can not be persisted.', 0, $e, 3);
		}

		if ($targetPersistAction->hasId()) {
			$persistAction->getMeta()->setRawValue($this->entityModel, $this->joinColumnName, 
					$this->getTargetIdEntityProperty()->buildRaw($targetPersistAction->getId(), $pdo));
			return;
		}
		
		$persistAction->addDependent($targetPersistAction);
		
		ArgUtils::assertTrue($valueHash instanceof ToOneValueHash);
		$targetPersistAction->executeAtEnd(function () use ($persistAction, $valueHash, $targetPersistAction, $pdo) {
			$targetId = $targetPersistAction->getId();
			
			$persistAction->getMeta()->setRawValue($this->entityModel, $this->joinColumnName, 
					$this->getTargetIdEntityProperty()->buildRaw($targetId, $pdo));
			
			$hasher = new ToOneValueHasher($this->getTargetIdEntityProperty());
			$hasher->reportId($targetId, $valueHash);
		});
	}
public function supplyPersistAction(PersistAction $persistAction, $value, ValueHash $valueHash, 
				?ValueHash $oldValueHash) {
		if ($value === null) {
			$persistAction->getMeta()->setRawValue($this->entityModel, $this->joinColumnName, null);
			return;
		}
		
		$actionQueue = $persistAction->getActionQueue();
		$pdo = $actionQueue->getEntityManager()->getPdo();
		$targetPersistAction = $persistAction->getActionQueue()->getPersistAction($value);

		try {
			$targetPersistAction = $persistAction->getActionQueue()->getPersistAction($value);
		} catch (PersistenceOperationException $e) {
			throw new PersistenceOperationException($this->entityProperty->toPropertyString() . ' of entity obj '
				. EntityInfo::buildEntityString($persistAction->getEntityModel(), $persistAction->getId())
				. ' contains value that can not be persisted.', 0, $e, 3);
		}

		if ($targetPersistAction->hasId()) {
			$persistAction->getMeta()->setRawValue($this->entityModel, $this->joinColumnName, 
					$this->getTargetIdEntityProperty()->buildRaw($targetPersistAction->getId(), $pdo));
			return;
		}
		
		$persistAction->addDependent($targetPersistAction);
		
		ArgUtils::assertTrue($valueHash instanceof ToOneValueHash);
		$targetPersistAction->executeAtEnd(function () use ($persistAction, $valueHash, $targetPersistAction, $pdo) {
			$targetId = $targetPersistAction->getId();
			
			$persistAction->getMeta()->setRawValue($this->entityModel, $this->joinColumnName, 
					$this->getTargetIdEntityProperty()->buildRaw($targetId, $pdo));
			
			$hasher = new ToOneValueHasher($this->getTargetIdEntityProperty());
			$hasher->reportId($targetId, $valueHash);
		});
	}
/* (non-PHPdoc)
@see \n2n\impl\persistence\orm\property\relation\Relation::supplyPersistAction()