-1

1st question on StackOverflow !

In HQL I try to execute the following query :

    FROM Device d
    LEFT JOIN FETCH d.listNotifications l
    WITH l.dateLastSending BETWEEN :startDate AND :endDate"
    WHERE d.registerId=:registerId";

But getting following the error : "with-clause not allowed on fetched associations; use filters"

Filters looks a little bit complicated to me.

Is there any issue to set a condition on the right table ?

Regards

Warren Sergent
  • 2,542
  • 4
  • 36
  • 42
Maxime
  • 168
  • 1
  • 9

1 Answers1

0

Remove FETCH clause.

(or try

FROM Device d
LEFT JOIN FETCH d.listNotifications l
WHERE (l.dateLastSending BETWEEN :startDate AND :endDate) AND (d.registerId=:registerId)

)

Luca Basso Ricci
  • 17,829
  • 2
  • 47
  • 69