[DDC-2246] Fix bug with UnitOfWork#getEntityState() and entities with foreign identifier.
Merge branch 'DDC-2246' into 2.3
Merge remote-tracking branch 'origin/2.3' into 2.3