我有一個可用的HQL查詢,我想優化。它如下:HQL查詢等價性:爲什麼它們不同
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=?
除了性能,我認爲這兩個查詢是等價的。 但他們不是。第一個是發送一組20個對象,而第二個發送只有14個對象。
我在做什麼錯?
任何提示?
很抱歉,但我不明白很好。他們是否等同? – Luixv 2009-05-28 14:36:37