@Transactional
  public void removeByPK(final ConfigGroupHostMappingEntityPK
                         configGroupHostMappingEntityPK) {
    populateCache();

    entityManagerProvider.get().remove(findByPK(configGroupHostMappingEntityPK));

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

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

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