posted 13 years ago
Hi,
I am using inner joins via HQL as well as Criteria API to understand the difference in execution between the two and found an interesting one:
I have two classes School and Student having a one-to-many association. On executing the 2 different code snippets given below and calling the list() method, SQL queries generated by both are same but:
- in 1st case (HQL), it returns Object[2] ([0] for Student and [1] for School)
- in 2nd case (Criteria API), it returns Student object only
What could be the explanation to this?
and