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

@param stackEntity Stack entity
@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