Wed, 24 Aug 2016 14:39:03 +0200Fixed 33771. Avoid double .list() call to not run query twice.
Stefan Hühner <stefan.huehner@openbravo.com> [Wed, 24 Aug 2016 14:39:03 +0200] rev 29898
Fixed 33771. Avoid double .list() call to not run query twice.

Old code ran following a OBCriteria
if (obc.list() == null || obc.list().size() == 0) {

However .list() does not return null as per Hibernate javadoc but empty or
non-empty list (of method raising an exception).

So remove the extra null check to avoid double .list() call.

Also improve .list().size() check slightly by using .list().isEmpty()

Add note that filter is on unique constraint so .list().size()<=1 also

Wed, 24 Aug 2016 14:23:41 +0200Fixed 33794. Avoid double .list() call by using .uniqueResult() instead.
Stefan Hühner <stefan.huehner@openbravo.com> [Wed, 24 Aug 2016 14:23:41 +0200] rev 29897
Fixed 33794. Avoid double .list() call by using .uniqueResult() instead.

Code did check for >1 result rows while reading from obserds_datasource.
However as the filter is on the name column and that column has an unique
constraint that case of >1 cannot happen.

So simplify to just call .uniqueResult() removing both .list() calls.

Wed, 24 Aug 2016 13:54:17 +0200Issue 33774. Apply review feedback, change .size() > 0 to !isEmpty()
Stefan Hühner <stefan.huehner@openbravo.com> [Wed, 24 Aug 2016 13:54:17 +0200] rev 29896
Issue 33774. Apply review feedback, change .size() > 0 to !isEmpty()

Wed, 24 Aug 2016 13:51:59 +0200Issue 33773. Apply review feedback replace .size() >0 with !isEmpty()
Stefan Hühner <stefan.huehner@openbravo.com> [Wed, 24 Aug 2016 13:51:59 +0200] rev 29895
Issue 33773. Apply review feedback replace .size() >0 with !isEmpty()

Tue, 23 Aug 2016 17:58:45 +0200Fixed 33774. Fixed accidental double query by not calling .list() twice
Stefan Hühner <stefan.huehner@openbravo.com> [Tue, 23 Aug 2016 17:58:45 +0200] rev 29894
Fixed 33774. Fixed accidental double query by not calling .list() twice

Tue, 23 Aug 2016 17:34:51 +0200Fixed 33773. Avoid double query by not calling .list() twice
Stefan Hühner <stefan.huehner@openbravo.com> [Tue, 23 Aug 2016 17:34:51 +0200] rev 29893
Fixed 33773. Avoid double query by not calling .list() twice

First case reading from ad_language can be simplified to single .uniqueResult
call as filters are unique.

2nd case just saves list() result to avoid 2nd call easily.

Wed, 24 Aug 2016 11:54:52 +0200Fixed 33790. Avoid double query with .count() + .list(). Add limit 1 to query
Stefan Hühner <stefan.huehner@openbravo.com> [Wed, 24 Aug 2016 11:54:52 +0200] rev 29892
Fixed 33790. Avoid double query with .count() + .list(). Add limit 1 to query

Query did .count() + then retrieve 1 record after adding extra order by.

This change removes the count as it only adds extra overhead and directly
does the real .list() query.
As the code only uses single row of result add extra limit 1 to reduce
number of result rows loaded into memory if many match the filter.
Simply code to use .uniqueResult() instead of .list().get(0)

Wed, 24 Aug 2016 11:08:58 +0200Fixed 33789. Avoid accidental double query by not calling .list() twice
Stefan Hühner <stefan.huehner@openbravo.com> [Wed, 24 Aug 2016 11:08:58 +0200] rev 29891
Fixed 33789. Avoid accidental double query by not calling .list() twice

Wed, 24 Aug 2016 10:12:12 +0200related to issue 33622: apply correct format
Carlos Aristu <carlos.aristu@openbravo.com> [Wed, 24 Aug 2016 10:12:12 +0200] rev 29890
related to issue 33622: apply correct format

Wed, 24 Aug 2016 00:56:21 +0000CI: merge back from main
RM packaging bot <staff.rm@openbravo.com> [Wed, 24 Aug 2016 00:56:21 +0000] rev 29889
CI: merge back from main