We're updating the issue view to help you get more done. 

jpa converter only applied to high value of cb.between

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(...)).

1 2 3 4 5 6 7 8 9 10 11 12 @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)); }

Environment

hibernate: 4.3.5, 4.3.6 or 4.3.7-snapshot
database: oracle 11g or h2 1.4.181

Status

Assignee

Brett Meyer

Reporter

Kristof Neirynck

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

backportReEvaluate

None

Fix versions

Affects versions

5.0.6

Priority

Major