'ISSUES:
* Updated relationships are not taken into account. Status: TODO'

def update_entity_from_doc(self, document):

    entity = self.__get_modified_entity(document.get('_id'))
    if (entity is not None):
        entity.update_from_document(document)
        entity.entity_metadata.update_from_document(document)
        self.__db_conn.session.commit()
        logger.info(u'A    {}    ({})    was    updated    in    Workspace    {}'.format(entity.entity_metadata.document_type, getattr(entity, 'name', '<no-name>'), self.__db_conn.db_name))
        return True
    logger.debug(u'Document    ({})    was    not    present    in    database    to    update'.format(document.get('_id')))
    return False
