Based on this thread I found a solution: https://discourse.hibernate.org/t/question-about-subselects-in-hibernate-6/6609 We cannot reuse the Expression<Boolean> used for Where. We have to make two instances of the Expression with different Roots. I’m not sure if this is intended, I’m not deep into this matter. Our problem is solved, though. Sorry for using up an issue number 😉 Maybe the exception could be more clear? |