JPA 判断字段值NULL

由于又忘了,故备注于此。


字段值为NULL

sql:字段 is null 即可

但放到JPA 上,则是 :

restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.isNull(root.get("store")));   //还有多种的其它用法,isEmpty,isFalse