@Transactional
  public void create(HostConfigMapping hostConfigMapping) {
    populateCache();
    
    //create in db
    entityManagerProvider.get().persist(buildHostConfigMappingEntity(hostConfigMapping));
    
    //create in cache
    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);
      }

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