Uploaded image for project: 'Hibernate ORM'
  1. HHH-9356

jpa converter only applied to high value of cb.between

    Details

      Description

      In this example I would expect both NINE and ELEVEN to be converted with the DollarsToCentsConverter.
      Only ELEVEN is.
      This problem doesn't ocur when using jpql.
      Also doesn't occur when using cb.and(cb.ge(...), cb.le(...)).

          @Test
          public void testCriteriaBetween9And11Is10() {
              System.out.println("*** testCriteriaBetween9And11Is10 ***");
              CriteriaBuilder cb = em.getCriteriaBuilder();
              CriteriaQuery<Amount> cq = cb.createQuery(Amount.class);
              Root<Amount> root = cq.from(Amount.class);
              List<Amount> resultListBetweenLowAndHighWithCB = em.createQuery(cq
                      .select(root)
                      .where(cb.between(root.get(Amount_.dollars), NINE, ELEVEN)))
                      .getResultList();
              assertThat(resultListBetweenLowAndHighWithCB.size(), is(1));
          }
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: