@RequiresSession
  public Optional<ViewURLEntity> findBySuffix(String urlSuffix) {
    TypedQuery<ViewURLEntity> query = entityManagerProvider.get().createNamedQuery("viewUrlBySuffix", ViewURLEntity.class);
    query.setParameter("urlSuffix", urlSuffix);
    try {
      return Optional.of(query.getSingleResult());
    } catch (NoResultException e) {
      return Optional.absent();
    }
  }
Find URL by suffix

@param urlSuffix
         the suffix to get the URL by
@return <code>Optional.absent()</code> if no view URL with the given suffix;
        otherwise an appropriate <code>Optional</code> instance holding the
        fetched view URL
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ViewURLDAO.java