code: @Override
      public Object getSingleResult()
      {
          // to fetch a single result form database.
          isSingleResult = true;
          List results = getResultList();
          isSingleResult = false;
          return onReturnResults(results);
      }
docs: /*
  (non-Javadoc)
  
  @see javax.persistence.Query#getSingleResult()