I'm still pretty new to Hibernate, so can I ask a stupid question prompted by this question?
How does Hibernate handle Cartesian (cross) products?
If the above query were written in SQL, my very limited understanding of Hibernate suggests it would look like:
SELECT * FROM Contact, Book
This would produce a combination of all possible row combinations from Contact and Book, with each row containing all attributes from both tables (which is why in SQL you always need a join condition to match the records from each table correctly e.g. WHERE Book.contact_id = Contact.contact_id).
Does Hibernate do the same thing here, or does it already know how to relate Contact and Book? And which objects does it return - Contact or Book - or does it already know how to cast the raw results back to one of these?
Actually, that's at least 3 stupid questions - sorry!