Project:
View Revisions: Issue #39380 | [ All Revisions ] [ Back to Issue ] | ||
Summary | 0039380: Support using both "-columnName" and "columnName desc" in HQL order by clauses | ||
Revision | 2019-06-13 16:55 by AugustoMauch | ||
Description | The AdvancedQueryBuilder does different things to HQL order by clauses built like "-columnName" and to clauses built like "columnName desc", even though they should be equivalent. There are two places where AdvancedQueryBuilder tries to parse the descendir order by the hql order by clause columns: - [1], to detect if all columns are in descending order, to add the id column in descending order too - [2], to parse the hql order by clase part to detect if it is a function If desc is used instead of -, [1] does not work properly. If - is used instead of desc, [2] does not work properly. Given that there are already several hql order by clauses defined with desc and with -, it is better to support both than to try to enforce using one of them [1] https://code.openbravo.com/erp/devel/pi/file/tip/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java#l1385 [^] [2] https://code.openbravo.com/erp/devel/pi/file/tip/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java#l1415 [^] |
||
Revision | 2018-09-28 15:02 by Sandrahuguet | ||
Description | In tabs, the hql order by clause must use "-" instead of "DESC" Example: accountingDate DESC -> dateAcct DESC , Fact_Acct_ID (when the query is translated to sql one column use DESC and the Fact_Acct_ID added for the platform ASC). -accountingDate -> DateAcct DESC , Fact_Acct_ID DESC (when the query is translated to sql both columns use DESC) Indexes only are applied when all columns have the same order |
||
Revision | 2018-09-28 15:02 by Sandrahuguet | ||
Description | In tabs the hql order by clause must use "-" instead of "DESC" Example: accountingDate DESC -> dateAcct DESC , Fact_Acct_ID (when the query is translated to sql one column use DESC and the Fact_Acct_ID added for the platform ASC). -accountingDate -> DateAcct DESC , Fact_Acct_ID DESC (when the query is translated to sql both columns use DESC) Indexes only are applied when all columns have the same order |
Copyright © 2000 - 2009 MantisBT Group |