1 Reply Latest reply on Nov 4, 2008 10:33 PM by sushi6677

    ResultCount higher than ResultList

    sushi6677

      Hi all,


      I have a strange behavioure here....
      I have a session bean derived from EntityQuery with some restrictions. As I also want to filter the results, I'm also modifying the query dynamically when caling getEjbq(). So I hae a query like this:


      select DISTINCT(document) from Document document, Keyword keyword where keyword.name IN ('alkynes', 'heterocycles', 'catalysis') and keyword member of document.keywords



      and in addtion a rrstriction which says year should be equal to 2005.


      Now in the JSF page I call the resultCount and I get back 5. But if I show all the results by calling documentList.resultList I just get back 3 elements (which seems to be right here).


      So any ideas why the resultCount get's back a size of 5 elements?


      Bests,
      Sushi

        • 1. Re: ResultCount higher than ResultList
          sushi6677

          Hi,


          I fonud out the reason but I still do not understand why it happens....
          So the resultCount counts all ocurrences of documents relate to the keywords without using the restriction. This means without using the year information. But on the page only the documents from 2005 are shown, so these are less.....
          But why is it like this? After the first search it works fine I get as total number 4 and I get 4 displyed but after redefining the query and making a super.refresh() the year information is not used for the resultCount().
          Has anybody an idea?


          Bests,
          Sushi