There are differences in how the various databases elect to sort nulls using a standard order by clause. Some databases (Postgres and Oracle I believe) support a "NULLS FIRST" or "NULLS LAST" grammar on the order by clause to dictate this.

I meant to package this up as a patch, but in our solution we provided consistent ordering regardless of database as well as the ability on an order-by element to indicate if you want the nulls ordered first or last for that particular field. There is also a new element in the entityengine.xml that indicates if a particular data source supports the "nulls-first" grammar.

If there is interest and a committer that would be willing to reivew, I can package this up ASAP and you can consider for back porting.

On Apr 23, 2010, at 11:18 AM, David E Jones wrote:


For that call the sorting is done in the database (not cached), so there's probably a difference in databases or database configs.

-David


On Apr 23, 2010, at 8:49 AM, Divesh Dutta wrote:

Hello Developers,

I see an strange issue on Release 9.04. But that issue does not exists on latest OFBiz trunk. Below is brief description of issue:

1) When I use any of the method (like findList or findByAnd) of DelegatorImpl.java class , and sort it by "sequenceNum", For eg in EditProductFeatures.groovy: (Release 9.04)

context.productFeatureAndAppls = delegator.findList('ProductFeatureAndAppl',
     EntityCondition.makeCondition([productId : productId]), null,
['sequenceNum', 'productFeatureApplTypeId', 'productFeatureTypeId', 'description'], null, false);

It returns me the list of values, with *Not-Null values at the top* , and then it sort in Ascending order by "sequenceNum", ......

2) But When I use Latest trunk in OFBiz: Using same example, It returns me the list sorted by "sequenceNum", .... in ascending order and then *Not-null values at the bottom

*3) I think this is the major bug in Release 9.04, because if we think at application level, if a catagory has over 800 products, Catalog Manager will have to go to the last page, to sequence every single product for it to show properly on the front end.

4) Instead if Catalog Manager want to sequence the products, he will arrange them at very first page.

5) I tried to found the reason of this major difference, but could not locate the exact fix in any of the commit. So I request all the developers, if any one have any idea regarding this please share your views here. Also I think this should be fixed in Release 9.04 as well.

Thanks
--
Divesh Dutta.



Robert Morley
Senior Software Developer
Emforium Group Inc.
ALL-IN Softwareâ„¢
519-772-6824 ext 220
rmor...@emforium.com

Reply via email to