You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Pawan Verma (JIRA)" <ji...@apache.org> on 2017/09/22 11:46:04 UTC

[jira] [Reopened] (OFBIZ-5701) Bug SQL Count Distinct command in GenericDAO.java

     [ https://issues.apache.org/jira/browse/OFBIZ-5701?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pawan Verma reopened OFBIZ-5701:
--------------------------------

Hey Guys,
I have tested this flow with both Static and Dynamic View Entity. It is working fine for the Static View(Tested for *PartyAndPerson* entity).
But in case of the Dynamic View, it is not working. Previously it was not applying distinct but now method getResultsSizeAfterPartialList() always returns 1 in all the cases.
Below is my testing View Entity:
{code}
workEffortAndGoodStandard = new DynamicViewEntity();

workEffortAndGoodStandard.addMemberEntity("WE", "WorkEffort");
workEffortAndGoodStandard.addAlias("WE", "workEffortId",null, null, false, true, null);
workEffortAndGoodStandard.addAlias("WE", "workEffortPurposeTypeId",null, null, false, true, null);

workEffortAndGoodStandard.addMemberEntity("WEGS", "WorkEffortGoodStandard");
workEffortAndGoodStandard.addAlias("WEGS", "workEffortId", null, null, false, true, null);
workEffortAndGoodStandard.addAlias("WEGS", "productId", null, null, true, true, null);
workEffortAndGoodStandard.addViewLink("WEGS", "WE", Boolean.FALSE, ModelKeyMap.makeKeyMapList("workEffortId", "workEffortId"));

workEffortAndGoodStandardListItr = select("productId").from(workEffortAndGoodStandard).distinct().queryIterator();
workEffortAndGoodStandardListSize = workEffortAndGoodStandardListItr.getResultsSizeAfterPartialList();
{code}

> Bug SQL Count Distinct command in GenericDAO.java 
> --------------------------------------------------
>
>                 Key: OFBIZ-5701
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5701
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: kieuanhvu
>            Assignee: Jacques Le Roux
>             Fix For: Release Branch 13.07, Release Branch 14.12, Release Branch 15.12, 16.11.04
>
>         Attachments: GenericDAO.java.patch, GenericDAO.java.patch, SQLDistinctGenericDAO.diff, SQLDistinctGenericDAO.diff
>
>
> I have encounter the problem is: How can ofbiz framework count distinct for all selected fields in query function of delegator? Although EntityFindOptions.setDistinct(true) and the selected fields are all field, the ofbiz framework always count distinct follow only one field.
> I have resolved problem as my attact file



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)