|
I'm running into this problem when using the Criteria API. I apologize I haven't had a chance to put together a formal test case, but the following snippet may help demonstrate the NPE -
CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery<Item> query = cb.createQuery(Item.class);
Root<Item> root = query.from(Item.class);
query.select(root).where(cb.equal(root.get("name"), cb.lower(cb.literal("MOUSE"))));
Item resultItem = entityManager.createQuery(query).getSingleResult();
assertNotNull(resultItem);
(Note that if cb.lower(cb.literal("MOUSE")) is replaced with the string literal "mouse", no exception is thrown.)
|