You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Nicolas Malin (JIRA)" <ji...@apache.org> on 2019/05/17 15:52:00 UTC

[jira] [Commented] (OFBIZ-11041) Incorrect findByCount on DynamicView with groupBy and selected field

    [ https://issues.apache.org/jira/browse/OFBIZ-11041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16842275#comment-16842275 ] 

Nicolas Malin commented on OFBIZ-11041:
---------------------------------------

Fixed at revision:
 * Trunk: 1859438
 * 18.12: 1859439
 * 17.12: 1859440

> Incorrect findByCount on DynamicView with groupBy and selected field
> --------------------------------------------------------------------
>
>                 Key: OFBIZ-11041
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11041
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Nicolas Malin
>            Assignee: Nicolas Malin
>            Priority: Minor
>
> When you create a DynamicView with group by function and you realize a delegator.findCountByCondition() with selected fields, the result was different than count each element returned by delegator.findList().
> In cause :
> {code:java}
> Index: framework/entity/src/main/java/org/apache/ofbiz/entity/datasource/GenericDAO.java
> @@ -1031,7 +1031,7 @@
>  
>          // GROUP BY clause for view-entity
>          if (isGroupBy) {
> -            modelViewEntity.colNameString(modelViewEntity.getGroupBysCopy(), sqlBuffer, " GROUP BY ", ", ", "", false);
> +            modelViewEntity.colNameString(modelViewEntity.getGroupBysCopy(selectFields), sqlBuffer, " GROUP BY ", ", ", "", false);
>          }
> {code}
> modelViewEntity.colNameString returns all grouped by fields for realize goup by closure and not only thegrouped by fields present on  selected fields.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)