@Transactional
  public void remove(final ConfigGroupHostMappingEntity
                         configGroupHostMappingEntity) {

    populateCache();

    entityManagerProvider.get().remove(merge(configGroupHostMappingEntity));

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

    if (setByHost != null) {
      CollectionUtils.filter(setByHost, new Predicate() {

        @Override
        public boolean evaluate(Object arg0) {
          return !((ConfigGroupHostMapping) arg0).getConfigGroupId().
              equals(configGroupHostMappingEntity.getConfigGroupId());
        }
      });
    }
  }
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