@Transactional
  public void removeByHostId(Long hostId) {
    populateCache();

    HostEntity hostEntity = hostDAO.findById(hostId);
    if (hostEntity != null) {
      if (hostConfigMappingByHost.containsKey(hostEntity.getHostId())) {
        // Delete from db
        TypedQuery<HostConfigMappingEntity> query = entityManagerProvider.get().createNamedQuery(
            "HostConfigMappingEntity.findByHostId", HostConfigMappingEntity.class);
        query.setParameter("hostId", hostId);

        List<HostConfigMappingEntity> hostConfigMappingEntities = daoUtils.selectList(query);

        for (HostConfigMappingEntity entity : hostConfigMappingEntities) {
          entityManagerProvider.get().remove(entity);
        }
        // Update the cache
        hostConfigMappingByHost.remove(hostEntity.getHostId());
      }
    }
  }
Used for host configuration mapping operations.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java