Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-5791

Query DSL : Projecting a Date field multiple times will render it as string

    XMLWordPrintable

Details

    Description

      Adding this in QueryDslConditionsTest fails. The second date projection is a String instead of being a Date. First projection is OK. The problem is gone if cache is not indexed, which makes me think it is more of a problem in CacheQuery.

         public void testDuplicateDateProjection() throws Exception {
            QueryFactory qf = getQueryFactory();
      
            Query q = qf.from(getModelFactory().getTransactionImplClass())
                  .select("id", "date", "date")
                  .having("description").eq("Hotel")
                  .toBuilder().build();
            List<Object[]> list = q.list();
      
            assertEquals(1, list.size());
            assertEquals(1, list.size());
            assertEquals(3, list.get(0).length);
            assertEquals(3, list.get(0)[0]);
            assertEquals(makeDate("2013-02-27"), list.get(0)[1]);
            assertEquals(makeDate("2013-02-27"), list.get(0)[2]);
         }
      

      Attachments

        Issue Links

          Activity

            People

              anistor Adrian Nistor (Inactive)
              anistor Adrian Nistor (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: