@RequiresSession
  public RepositoryVersionEntity findByStackAndVersion(StackId stackId,
      String version) {
    return findByStackNameAndVersion(stackId.getStackName(), version);
  }
Retrieves repository version by stack.

@param stackId
         stackId
@param version
         version
@return null if there is no suitable repository version
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/RepositoryVersionDAO.java