Problem met when upgrade from querydsl 3 to 4

62 views
Skip to first unread message

Dom

unread,
Nov 30, 2017, 3:34:07 AM11/30/17
to Querydsl
Hello gentlemen,

I meet a problem when upgrade querydsl from v3 to v4:

in v3:
from(qDeliveryTrace)
   
.where(qDeliveryTrace.modifiedDate.between(startDate, endDate)
     
.and(qDeliveryTrace.orderResultCode.in(orderCodes)))
   
.exists()
it returns Boolean

I wonder how should it be expressed in v4, could anyone help?

Thanks a lot for your attention!

Richard Richter

unread,
Nov 30, 2017, 11:17:03 AM11/30/17
to Querydsl
Hi

Is this the JPA support or SQL or what? Also what did you use this construct for?

Virgo

Dom

unread,
Dec 2, 2017, 9:29:32 AM12/2/17
to Querydsl
For now, I can come up with 1 solution:

!from(qDeliveryTrace)
   
.where(qDeliveryTrace.modifiedDate.between(startDate, endDate)
     
.and(qDeliveryTrace.orderResultCode.in(orderCodes))
     
.and(qDeliveryTrace.subscriptionId.in(subscriptionIds)))
   
.fetchResults().isEmpty()

Nelson

unread,
Dec 12, 2017, 5:37:50 AM12/12/17
to Querydsl
What about:

from(qDeliveryTrace)
   
.where(qDeliveryTrace.modifiedDate.between(startDate, endDate)
   
.and(qDeliveryTrace.orderResultCode.in(orderCodes)))
   
.select(Expressions.ONE).fetchFirst() != null

Reply all
Reply to author
Forward
0 new messages