Cayenne forces DISTINCT in the generated SQL whether you specify it or not 
because it detects a match on to-many relationship and realizes that it needs 
to get rid of duplicates in the cartesian product. So I guess explicit DISTINCT 
shouldn’t normally be needed.

As to why NULL is bound in the DISTINCT case, this could either be a yet 
unknown bug in the framework, or something in the app code.

Andrus

On Nov 13, 2013, at 1:15 AM, Aristedes Maniatis <a...@maniatis.org> wrote:

> 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
> 
> 
> 
> 
> 
> -- 
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
> 

Reply via email to