I\'ve searched and not found anyone with this problem.
I\'ve created my own Data Transformer as set out in the Cookbook and it all seems right but i get the error:
I just created an input type hidden:
$builder->add('child_id', 'hidden', array('mapped' => false))
In the newAction I did fill with the parent id:
$childForm->get('parent_id')->setData($parentEntity->getId());
And finally in createAction I did put:
$child->setParent($em->getReference('MyBundle:Parent', $form["child_id"]->getData()))
PS: I understand that you wanted to create your Data Transformer, but if your problem is persist object with parent id, it will help you.