protected void readEntity(Entity entity) { if (entity != null) { String entityId = readAttribute(ENTITY_ID_ATTR_NAME, null); if ("null".equals(entityId)) { entityId = null; } assert entityId != null : "Entity id must be provided"; entity.setEntityId(entityId); String queryId = readAttribute(QUERY_ID_ATTR_NAME, null); if ("null".equals(queryId)) { queryId = null; } assert queryId != null : "Query id must be provided"; entity.setQueryName(queryId); assert model != null; entity.setModel(model); model.addEntity(entity); } }