DataMap map = mediator.getCurrentDataMap();
Query matchingQuery = map.getQuery(newName);
if (matchingQuery == null) {
// completely new name, set new name for entity
QueryEvent e = new QueryEvent(this, query, query.getName());
ProjectUtil.setQueryName(map, query, newName);
mediator.fireQueryEvent(e);
}
else if (matchingQuery != query) {
// there is a query with the same name