1 year ago

#76165

test-img

Sally Mwalr

How does CriteriaQuery isNull slow down hibernate query?

What makes this query perform differently?

CriteriaBuilder builder;
CriteriaQuery criteria;
Root root;

criteria.where(builder.anyOtherCondition()); // runs at a reasonable speed
criteria.where(builder.isNull(root.get("name"))); // takes years

It's as though hibernate is fetching all the data in the database.

java

hibernate

jpa

0 Answers

Your Answer

Accepted video resources