OK so we should do a group by then a sortby Modify date; and then by name..


Jeff Faath wrote:
I forget where, but the spec states that the first name is considered the
primary name and therefore the one that should be considered for the sort.
Part of the reason why I had that requirement a while back to preserve the
order of the various child fields.

-----Original Message-----
From: Kurt T Stam [mailto:[email protected]] Sent: Thursday, August 13, 2009 11:35 PM
To: [email protected]
Subject: [DISCUSSION] Finders and sort by - Invalid SQL

Hi guys,

When we do searches for BusinessEntities, BindingTemplates, Services and TModels we sort by name. However the name is not in the business_entity table, but rather in the business_name, because multiple business names can be given (for different locales). In the code we select the business entity and then try to sort by name. Some dbs think this is ok, but in fact most of them do not like it (including Derby). You get an error which is explained pretty well in this article: http://weblogs.sqlteam.com/jeffs/archive/2007/12/13/select-distinct-order-by
-error.aspx

So we can fix this by not doing a "select distinct" but rather doing a "group by". However it begs the question what it means to sort by name.. I guess you'd only want to sort within one locale, but we may not always have a name in each locale. So should we simply sort
by business_entity key instead?

Here are some examples:
./src/main/java/org/apache/juddi/query/FetchBindingTemplatesQuery.java: private static void appendSortTables(DynamicQuery qry) ./src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java: private static void appendSortTables(DynamicQuery qry) ./src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java: private static void appendSortTables(DynamicQuery qry) { ./src/main/java/org/apache/juddi/query/FetchTModelsQuery.java: private static void appendSortTables(DynamicQuery qry) {

--Kurt




Reply via email to