@RequiresSession
  public Optional<ViewURLEntity> findByName(String urlName) {
    TypedQuery<ViewURLEntity> query = entityManagerProvider.get().
            createNamedQuery("viewUrlByName", ViewURLEntity.class);
    query.setParameter("urlName", urlName);
    try {
      return Optional.of(query.getSingleResult());
    } catch (Exception e){
      return Optional.absent();
    }
  }
Find URL by name
@param urlName
@return
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ViewURLDAO.java