QueryDSL与BooleanBuilder交叉连接

时间:2017-06-28 14:13:27

标签: spring jpa querydsl

Easy BooleanBuilder

booleanBuilder.and(QOrder.order.validationStatus.eq(ValidationStatus.ACCOUNTED))

.and(QOrder.order.orderAddress().id.isNull());

生成交叉连接

from order order0_ cross join order_address orderaddr1_ where 
order0_.id=orderaddr1_.order_id and order0_ .validation_status=? and 
(orderaddr1_.order_id is null)

因此它永远不会工作,因为交叉连接总是返回空结果集,所以从不发生null检查。除了直接使用JPAQuery之外还有其他解决方案吗?

0 个答案:

没有答案