[DDC-2246] Fix bug with UnitOfWork#getEntityState() and entities with foreign identifier.
Merge branch 'DDC-2246'