3 Replies Latest reply on Oct 21, 2008 5:52 PM by gjeudy

    Using temporary tables

    sushi6677

      Hi all!


      I'm currently working on a problem where one solution could be a temporary table...
      So in short: Is it possible to create a temporary table out of an EntityQuery resultList with seam?


      And the long version of the question....
      I'm making a query to the database based on an EntityQuery object. Thsi gives me some documents back. Based on these documents I generate some facetes which always contains a name and the number of occurences (e.g. 2005 [10] 2004 [20]). Now if I select one of the facetes I want to filter the results. So I can requery the database with a restriction on the year according to the selected facete. And this works fine already. But now there is the problem: After I requery the DB the facetes will change because of the changed resultList. But the facetes should always stay according to the first resultList. So is there an easy way to disconnect the facetes without using temporary tables?


      Bests,
      Sushi

        • 1. Re: Using temporary tables
          gjeudy

          I'm not sure I understand, are you using different xhtml pages (facelets) each having a different filter backed by the same EntityQuery instance and you use a long-running conversation ?

          • 2. Re: Using temporary tables
            sushi6677

            Hi,


            no! I have one page! Here you can place the query and the result list appears (like the EntityList.xhtml pages sem-gen generates for you). But additionally I have a rich:tabPanel on exactly the same page showing me the facetes of the search result like I described above.
            So the idea (implemented in PHP) can also be found here: http://dblp.l3s.de


            Bests,
            Sushi



            • 3. Re: Using temporary tables
              gjeudy

              ok now I understand what you are trying to achieve. I dont think there's an easy solution for this.


              You need your tabPanel with the facetes of the search results backed by a copy of the first result list that you only reset when the user triggers another search.