public EntityAttributeGroup updateEntityAttributeGroup(EntityAttributeGroup entityAttributeGroup)
      throws ApplicationException {
    if (entityAttributeGroup == null) {
      return null;
    }

    if (entityAttributeGroup.getEntityAttributeGroupId() == null
        || entityAttributeGroup.getEntityAttributes() == null) {
      throw new ApplicationException(
          "An entity attribute group must first be created before it is updated.");
    }

    try {
      entityDefinitionDao.updateEntityAttributeGroup(entityAttributeGroup);
      return entityAttributeGroup;
    } catch (DaoException e) {
      throw new ApplicationException(e.getMessage());
    }
  }