@RequiresSession
  public RepositoryVersionEntity findByDisplayName(String displayName) {
    // TODO, this assumes that the display name is unique, but neither the code nor the DB schema enforces this.
    final TypedQuery<RepositoryVersionEntity> query = entityManagerProvider.get().createNamedQuery("repositoryVersionByDisplayName", RepositoryVersionEntity.class);
    query.setParameter("displayname", displayName);
    return daoUtils.selectSingle(query);
  }
Retrieves repository version by name.

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