@Transactional
  public void createGroups(List<AlertGroupEntity> entities) {
    if (null == entities) {
      return;
    }

    List<AlertGroupUpdate> alertGroupUpdates = new ArrayList<>(entities.size());
    for (AlertGroupEntity entity : entities) {
      create(entity, false);
      alertGroupUpdates.add(new AlertGroupUpdate(entity));
    }
    AlertGroupsUpdateEvent alertGroupsUpdateEvent = new AlertGroupsUpdateEvent(alertGroupUpdates,
        UpdateEventType.CREATE);
    STOMPUpdatePublisher.publish(alertGroupsUpdateEvent);
  }
Persists new alert groups.

@param entities
         the groups to persist (not {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java