From: Doug C. <de...@fl...> - 2002-02-25 22:31:55
|
When constructing the SQL for the find Query#renderSQL() is making an array of persisters. In my case, the array has a persister for "baz1" followed by a persister for "bar" The order depends on the iterator returned by types.keySet() in returnTypes.addAll( types.keySet() ); Since types is a HashMap, the order is implementation dependent. This leads to selectIDString= "baz1.idcode as idcode0, bar.foo_id as foo_id1" later in Query#renderSQL() we have... //SELECT buf = new StringBuffer("SELECT "); distinct=true; for ( int i=0; i<size; i++ ) { if ( !persisters[i].selectDistinct() ) distinct=false; break; } Note that this breaks after the first tested persister no matter what the outcome. Since baz is first in my case, the select remains DISTINCT; but it should be ALL. Perhaps this code should be: //SELECT buf = new StringBuffer("SELECT "); distinct=true; for ( int i=0; i<size; i++ ) { if ( !persisters[i].selectDistinct() ) { distinct=false; break; } } I have made this change in the CVS; it fixes the problem for me. Now all FooBarTests pass with Mckoi and jdk 1.4. e |