Revert "Issue #1003788 by stefan.r, Alan D., Josh Waihi, JimmyAx, robhardwick, wiifm, twistor, pwolanin, bzrudi71, bellHead, john_brown: Fixed PostgreSQL: PDOException:Invalid text representation when attempting to load an entity with a string or non-scalar ID."

This reverts commit 4086829bbe01648c79c06ad7ecb0b36b3ce3aa8a.
Issue #1906810 by dawehner, damiankloip, tstoeckler, kgoel, fubhy, jrglasgow, xjm, Gaelan, socketwench: Require type hints for automatic entity upcasting.