[infinispan-issues] [JBoss JIRA] (ISPN-5791) Query DSL : Projecting a Date field multiple times will render it as string

Adrian Nistor (JIRA) issues at jboss.org
Thu Sep 24 10:37:00 EDT 2015


     [ https://issues.jboss.org/browse/ISPN-5791?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Nistor updated ISPN-5791:
--------------------------------
    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.

{code}
   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]);
   }
{code}

  was:
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.

{quote}
   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]);
   }
{quote}



> Query DSL : Projecting a Date field multiple times will render it as string
> ---------------------------------------------------------------------------
>
>                 Key: ISPN-5791
>                 URL: https://issues.jboss.org/browse/ISPN-5791
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Embedded Querying
>    Affects Versions: 8.0.1.Final, 8.1.0.Alpha1
>            Reporter: Adrian Nistor
>            Assignee: Adrian Nistor
>
> 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.
> {code}
>    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]);
>    }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the infinispan-issues mailing list