@RequiresSession
  public UpgradeEntity findUpgradeByRequestId(Long requestId) {
    TypedQuery<UpgradeEntity> query = entityManagerProvider.get().createNamedQuery(
        "UpgradeEntity.findUpgradeByRequestId", UpgradeEntity.class);

    query.setParameter("requestId", requestId);

    return daoUtils.selectSingle(query);
  }
Finds a specific upgrade
@param upgradeId the id
@return the entity, or {@code null} if not found
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java