Added method patchEntity which returns a patched entity