Hi I have a working HQL query which I want to optimize. It is as follows:
select distinct A.id from Import as A, Place D
where (A.place=D or A.placeBOK=D) and D.country=?
I tried to replcae the query from above by the following:
select distinct A.id from Import as A
where A.place.country=? or A.placeBOK.country=?
Besides performance I thought that both queries are equivalent. But they are not. The first is delivering a set of 20 objects whereas the second is delivering only 14 objects.
What am I doing wrong?
Any hint?