@Transactional
  public void removeAllByHost(Long hostId) {
    TypedQuery<String> query = entityManagerProvider.get().createQuery
      ("DELETE FROM ConfigGroupHostMappingEntity confighosts WHERE " +
        "confighosts.hostId = ?1", String.class);

    daoUtils.executeUpdate(query, hostId);


    Set<ConfigGroupHostMapping> setByHost = configGroupHostMappingByHost.get(hostId);

    setByHost.clear();
  }
Return entity object which can be used for operations like remove
directly.
@param configGroupHostMappingEntityPK
@return
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java