Jira issue originally created by user bas.wad:
The classname given to the EntityPersister by the ProxyFactory includes a backslash '\' in front of the namespace while normal classes and the proxy itself don't have this. This issue causes it impossible to persist proxyclasses, because of the string comparison in UnitOfWork::executeUpdates in the statement [ getparentclass($entity) == $className ] this will do 'some\namespace\someclass' == '\some\namespace\someclass'
Aftter some debugging work it seems the '\' is trimmed of when getting the ClassMetadata while this isn't done when a the proxyfactory creates the proxy. So it is probably fixed by placing:
$className = ltrim($className, '\');
at the start of ProxyFactory::getProxy where '\' is actually a double backslash but that cannot be posted here
Comment created by @guilhermeblanco:
That was not the issue, but it was a good starting point.
The actual problem was during mapping that targetEntity never ltrim'ed the entity name referred there.
Internally, Hydrator and UnitOfWork consume the ProxyFactory directly, so it lead to a wrong hashmap key for persisters.
By fixing the targetEntity value, everything is fixed. =)
Issue was closed with resolution "Fixed"
Comment created by @beberlei:
merged into 2.1.x