@Transactional
  void persistEntities(ConfigGroupEntity configGroupEntity) throws AmbariException {
    ClusterEntity clusterEntity = clusterDAO.findById(cluster.getClusterId());
    configGroupEntity.setClusterEntity(clusterEntity);
    configGroupEntity.setTimestamp(System.currentTimeMillis());
    configGroupDAO.create(configGroupEntity);

    configGroupId = configGroupEntity.getGroupId();

    persistConfigMapping(clusterEntity, configGroupEntity, m_configurations);
    replaceHostMappings(m_hosts);
  }
Persist Config group with host mapping and configurations

@throws Exception
ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java