From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-30 15:45:20
|
>If I execute this select directly in the db I get 77 results, but >Hibernate returns only 11. Thats *highly* wierd and I don't understand how it could be true.... we need to try and understand this better. Could you try stepping through code to see if the JDBC ResultSet actually contains 77 rows? (Hibernate *does* actually have an extra layer to force distinctness of results which were retrieved from the database *without* SELECT DISTINCT but I don't really see how this could be malfunctioning....) >Another problem is that hibernate uses one more join than it actually >should, (the shops table is accessed two times, and joined with itself >on the primary key :)) Thanks for spotting this. This is an old bug I think. The code wasn't being sufficiently selective in differentiating one-to-many associations from many-to-many. Its now fixed in CVS. Please grab a latest CVS snapshot and try stepping through code for me. (Note that the generated SQL will be different this time.) TIA Gavin |