Setting Parent ID (foreign key value) directly

That should be as simple as doing

Parent.Id := ParentId;
Child.Id := ChildId;
Child.Parent := Parent;