So really there is little to no use for setDistinct in a SelectQuery.
Anyway I was more concerned about the Where clause, I can assure that I
am using a non null owner but even then owner is a User object so there
is no reason why Cayenne should try to match agains a Contact and
distinct
So really there is little to no use for setDistinct in a SelectQuery.
I think so too. Other than some messed up DB with de-facto non-unique PK, I
can’t think why that would be needed.
Andrus if you want I can open a Jira Issue
Yes please. And I wonder if we should just deprecate ‘distinct’
With regards to:
I wonder if we should just deprecate distinct as a solution.
What about making it a no op ? With the Java doc explaining that it does
nothing because Cayenne forces DISTINCT in the generated SQL whether you
specify it or not because it detects a match on to-many relationship
On 13/11/2013 3:59am, Ramiro Aparicio wrote:
I am really not sure if current behaviour without distinct is ok, but at
least it works for me.
Cayenne returns a collection of objects that will never have duplicates. In
fact you can choose whether the results return as a Set, List or Map.
Ari