Are you proposing the following change?
public QueryDefinition selectDistinct(List<SelectItem> items) {
- return select(items, false);
+ return select(items, true);
}
Please open a JIRA so we can check in the fix and consider if we need a
new junit testcase to cover this.
Thanks.
-Donald
Tan bupt wrote:
I think it is a bug in
org.apache.openjpa.persistence.query.QueryDefinitionImpl, can we fix it?
public QueryDefinition selectDistinct(SelectItem... items) {
return select(items == null ? null : Arrays.asList(items), true);
}
public QueryDefinition selectDistinct(List<SelectItem> items) {
return select(items, false);
}
private QueryDefinition select(List<SelectItem> items, boolean isDistinct)
{
if (_projections == null) {
_projections = new ArrayList<SelectItem>();
} else {
_projections.clear();
}
_distinct = isDistinct;
for (SelectItem item : items)
_projections.add(item);
return this;
}