@Transactional
  public HostConfigMapping merge(HostConfigMapping hostConfigMapping) {
    populateCache();

    Long hostId = hostConfigMapping.getHostId();
    if (hostId != null) {
      Set<HostConfigMapping> set;
      if (hostConfigMappingByHost.containsKey(hostId)) {
        set = hostConfigMappingByHost.get(hostId);
      } else {
        set = new HashSet<>();
        hostConfigMappingByHost.put(hostId, set);
      }

      //Update object in set
      set.remove(hostConfigMapping);
      set.add(hostConfigMapping);

      entityManagerProvider.get().merge(buildHostConfigMappingEntity(hostConfigMapping));
    }

    return hostConfigMapping;
  }
Used for host configuration mapping operations.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java