if (entity == null || Util.nullSafeEquals(newName, entity.getName())) {
return;
}
if (newName == null) {
throw new ValidationException("Entity name is required.");
} else if (entity.getDataMap().getDbEntity(newName) == null) {
// completely new name, set new name for entity
EntityEvent e = new EntityEvent(this, entity, entity.getName());
entity.setName(newName);
// ProjectUtil.setDbEntityName(entity, newName);
mediator.fireDbEntityEvent(e);
} else {
// there is an entity with the same name
throw new ValidationException("There is another entity with name '" + newName + "'.");
}
}