when I run HQL like
from SnsUser s join fetch s.participants p join fetch p.interaction i join fetch i.content c where s.blessUid=1
(returning List(SnsUser) list)
it gives me let say 10 rows and in each row (i.e. SnsUser) has 10 rows as Participant.
But when i run like a HQL like
from Participant p join fetch p.snsUser s join fetch p.interaction i join fetch i.content c where s.blessUid=1
it gives me 10 rows and i can get the relevant SnsUser from it. BUT when i look at the actual sql query it is same for the both. Why it behaves like this... ?
answers would be appreciated. al
I'm skeptic, both queries shouldn't be the same (one should be performed against the SnsUser
table and the other should be performed against the Participant
table).
And because I only trust what I see, I won't change my mind until you show the generated queries (and the mapping allowing to fully understand the model).
精彩评论