Shifted Common Database Code of All Classes to Entity Class