6 Replies Latest reply on May 4, 2010 10:17 AM by yelin666

    A question on query API

    yelin666

      In the "Sample code - how do I enable and use the Query API" of "Querying Infinispan" section in the User Guide, during QueryHelper construction if "myClassToQuery" is a top level class, it won't be able to query a field from the subclass of "myClassToQuery". Is that correct?

        • 1. Re: A question on query API
          manik

          You will need to annotate and add the subclasses as well.

          • 2. Re: A question on query API
            yelin666

            So basically, I can declare the cache with the top level class (say TopClass), and annotate and add subclasses (say SubClassA & SubClassB) when constructing QueryHelper as follows:

             

            Cache<String,TopClass> cache = new DefaultCacheManager(cfg).getCache();

            QueryHelper qh = new QueryHelper(cache, new Properties(), TopClass.class, SubClassA.class, SubClassB.class);

             

            Is that correct? Where can I get more information on query API? The section about query in User Guide 4.1 seems the same as in last version.

            • 3. Re: A question on query API
              manik

              Lin Ye wrote:

               

              So basically, I can declare the cache with the top level class (say TopClass), and annotate and add subclasses (say SubClassA & SubClassB) when constructing QueryHelper as follows:

               

              Cache<String,TopClass> cache = new DefaultCacheManager(cfg).getCache();

              QueryHelper qh = new QueryHelper(cache, new Properties(), TopClass.class, SubClassA.class, SubClassB.class);

               

              Is that correct? Where can I get more information on query API? The section about query in User Guide 4.1 seems the same as in last version.

              Yes that is correct.

               

              There is no change from what was in 4.0, so the stuff you see under 4.0 is still valid.

              • 4. Re: A question on query API
                yelin666

                In 4.0 doc it's said "there is a temporary helper class - QueryHelper". Will the QueryHelper be taken away in 4.1?

                • 5. Re: A question on query API
                  manik

                  The original plan was to take this away in 4.1 but more realistically, this won't happen till 5.0 due to some dependencies on Hibernate Search.

                  • 6. Re: A question on query API
                    yelin666

                    Got you. Thank, Manik.