سؤال

I have 3 Table A, B, C related with Many-To-One

is there difference between these two?

"SELECT a FROM A a "
    + "INNER JOIN a.b b "
    + "INNER JOIN b.c "

"SELECT c.b.a FROM C c "

I have tested both, and both work how I want. However, is there any real difference?

هل كانت مفيدة؟

المحلول

The second query is invalid in the associations really are ManyToMany.

If they are ManyToOne or OneToOne, then the two queries are valid and equivalent.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top