@RequiresSession
  public List<RepositoryVersionEntity> findByServiceDesiredVersion(List<RepositoryVersionEntity> matching) {
    TypedQuery<RepositoryVersionEntity> query = entityManagerProvider.get().
            createNamedQuery("findByServiceDesiredVersion", RepositoryVersionEntity.class);

    return daoUtils.selectList(query, matching);
  }
Retrieves the repo versions matching the provided ones that are currently being used
for a service.

@param matching  the list of repo versions
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/RepositoryVersionDAO.java