Re: Issue with distinct 3.1

2013-11-13 Thread Ramiro Aparicio
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

Re: Issue with distinct 3.1

2013-11-13 Thread Andrus Adamchik
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’

Re: Issue with distinct 3.1

2013-11-13 Thread dollj
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

Re: Issue with distinct 3.1

2013-11-12 Thread Aristedes Maniatis
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