added query support to updateEntity method