ObjectSelect without DISTINCT

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ObjectSelect without DISTINCT

Lon Varscsak
Hey guys, is there any way to do an ObjectSelect and specify to not use
“DISTINCT”?  I have tables that have blob columns and Sybase doesn’t allow
distinct on them.

Thanks,

Lon
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ObjectSelect without DISTINCT

Lon Varscsak
Oops, I spoke too soon.  ObjectSelect isn’t my issue, it’s the firing a
to-one relationship…hmmm.

-Lon

On Tue, Dec 20, 2016 at 7:56 AM, Lon Varscsak <[hidden email]>
wrote:

> Hey guys, is there any way to do an ObjectSelect and specify to not use
> “DISTINCT”?  I have tables that have blob columns and Sybase doesn’t allow
> distinct on them.
>
> Thanks,
>
> Lon
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ObjectSelect without DISTINCT

Lon Varscsak
And…turns out a problem in the model (to dependent PK missing). :P

On Tue, Dec 20, 2016 at 8:00 AM, Lon Varscsak <[hidden email]>
wrote:

> Oops, I spoke too soon.  ObjectSelect isn’t my issue, it’s the firing a
> to-one relationship…hmmm.
>
> -Lon
>
> On Tue, Dec 20, 2016 at 7:56 AM, Lon Varscsak <[hidden email]>
> wrote:
>
>> Hey guys, is there any way to do an ObjectSelect and specify to not use
>> “DISTINCT”?  I have tables that have blob columns and Sybase doesn’t allow
>> distinct on them.
>>
>> Thanks,
>>
>> Lon
>>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ObjectSelect without DISTINCT

Andrus Adamchik
Glad when the problems solve themselves by the time I finish reading a thread :)

Andrus

> On Dec 20, 2016, at 6:18 PM, Lon Varscsak <[hidden email]> wrote:
>
> And…turns out a problem in the model (to dependent PK missing). :P
>
> On Tue, Dec 20, 2016 at 8:00 AM, Lon Varscsak <[hidden email]>
> wrote:
>
>> Oops, I spoke too soon.  ObjectSelect isn’t my issue, it’s the firing a
>> to-one relationship…hmmm.
>>
>> -Lon
>>
>> On Tue, Dec 20, 2016 at 7:56 AM, Lon Varscsak <[hidden email]>
>> wrote:
>>
>>> Hey guys, is there any way to do an ObjectSelect and specify to not use
>>> “DISTINCT”?  I have tables that have blob columns and Sybase doesn’t allow
>>> distinct on them.
>>>
>>> Thanks,
>>>
>>> Lon
>>>
>>
>>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ObjectSelect without DISTINCT

Lon Varscsak
Haha, yeah.  If only all problems solved themselves that way. :)

On Tue, Dec 20, 2016 at 11:00 PM, Andrus Adamchik <[hidden email]>
wrote:

> Glad when the problems solve themselves by the time I finish reading a
> thread :)
>
> Andrus
>
> > On Dec 20, 2016, at 6:18 PM, Lon Varscsak <[hidden email]>
> wrote:
> >
> > And…turns out a problem in the model (to dependent PK missing). :P
> >
> > On Tue, Dec 20, 2016 at 8:00 AM, Lon Varscsak <[hidden email]>
> > wrote:
> >
> >> Oops, I spoke too soon.  ObjectSelect isn’t my issue, it’s the firing a
> >> to-one relationship…hmmm.
> >>
> >> -Lon
> >>
> >> On Tue, Dec 20, 2016 at 7:56 AM, Lon Varscsak <[hidden email]>
> >> wrote:
> >>
> >>> Hey guys, is there any way to do an ObjectSelect and specify to not use
> >>> “DISTINCT”?  I have tables that have blob columns and Sybase doesn’t
> allow
> >>> distinct on them.
> >>>
> >>> Thanks,
> >>>
> >>> Lon
> >>>
> >>
> >>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ObjectSelect without DISTINCT

Lon Varscsak
Actually, this will lead me to a question.  While poking around in
ObjectSelect it occurred to me that the chaining API doesn’t appear to have
a “distinct” option.  If I were qualifying through a to-many relationship
will ObjectSelect just do the right thing and use a DISTINCT?

-Lon

On Wed, Dec 21, 2016 at 10:17 AM, Lon Varscsak <[hidden email]>
wrote:

> Haha, yeah.  If only all problems solved themselves that way. :)
>
> On Tue, Dec 20, 2016 at 11:00 PM, Andrus Adamchik <[hidden email]>
> wrote:
>
>> Glad when the problems solve themselves by the time I finish reading a
>> thread :)
>>
>> Andrus
>>
>> > On Dec 20, 2016, at 6:18 PM, Lon Varscsak <[hidden email]>
>> wrote:
>> >
>> > And…turns out a problem in the model (to dependent PK missing). :P
>> >
>> > On Tue, Dec 20, 2016 at 8:00 AM, Lon Varscsak <[hidden email]>
>> > wrote:
>> >
>> >> Oops, I spoke too soon.  ObjectSelect isn’t my issue, it’s the firing a
>> >> to-one relationship…hmmm.
>> >>
>> >> -Lon
>> >>
>> >> On Tue, Dec 20, 2016 at 7:56 AM, Lon Varscsak <[hidden email]>
>> >> wrote:
>> >>
>> >>> Hey guys, is there any way to do an ObjectSelect and specify to not
>> use
>> >>> “DISTINCT”?  I have tables that have blob columns and Sybase doesn’t
>> allow
>> >>> distinct on them.
>> >>>
>> >>> Thanks,
>> >>>
>> >>> Lon
>> >>>
>> >>
>> >>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ObjectSelect without DISTINCT

Andrus Adamchik
This is intentional. DISTINCT is automatically added by Cayenne to the generated SQL when it detects a to-many in the qualifier. So I don't see a use case for an explicit DISTINCT API (until we start supporting fetching individual columns via ObjectSelect, which we may).

Andrus
 

> On Dec 21, 2016, at 8:19 PM, Lon Varscsak <[hidden email]> wrote:
>
> Actually, this will lead me to a question.  While poking around in
> ObjectSelect it occurred to me that the chaining API doesn’t appear to have
> a “distinct” option.  If I were qualifying through a to-many relationship
> will ObjectSelect just do the right thing and use a DISTINCT?
>
> -Lon
>
> On Wed, Dec 21, 2016 at 10:17 AM, Lon Varscsak <[hidden email]>
> wrote:
>
>> Haha, yeah.  If only all problems solved themselves that way. :)
>>
>> On Tue, Dec 20, 2016 at 11:00 PM, Andrus Adamchik <[hidden email]>
>> wrote:
>>
>>> Glad when the problems solve themselves by the time I finish reading a
>>> thread :)
>>>
>>> Andrus
>>>
>>>> On Dec 20, 2016, at 6:18 PM, Lon Varscsak <[hidden email]>
>>> wrote:
>>>>
>>>> And…turns out a problem in the model (to dependent PK missing). :P
>>>>
>>>> On Tue, Dec 20, 2016 at 8:00 AM, Lon Varscsak <[hidden email]>
>>>> wrote:
>>>>
>>>>> Oops, I spoke too soon.  ObjectSelect isn’t my issue, it’s the firing a
>>>>> to-one relationship…hmmm.
>>>>>
>>>>> -Lon
>>>>>
>>>>> On Tue, Dec 20, 2016 at 7:56 AM, Lon Varscsak <[hidden email]>
>>>>> wrote:
>>>>>
>>>>>> Hey guys, is there any way to do an ObjectSelect and specify to not
>>> use
>>>>>> “DISTINCT”?  I have tables that have blob columns and Sybase doesn’t
>>> allow
>>>>>> distinct on them.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Lon
>>>>>>
>>>>>
>>>>>
>>>
>>>
>>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ObjectSelect without DISTINCT

Lon Varscsak
Gotcha, sounds good.

-Lon

On Wed, Dec 21, 2016 at 11:24 PM, Andrus Adamchik <[hidden email]>
wrote:

> This is intentional. DISTINCT is automatically added by Cayenne to the
> generated SQL when it detects a to-many in the qualifier. So I don't see a
> use case for an explicit DISTINCT API (until we start supporting fetching
> individual columns via ObjectSelect, which we may).
>
> Andrus
>
>
> > On Dec 21, 2016, at 8:19 PM, Lon Varscsak <[hidden email]>
> wrote:
> >
> > Actually, this will lead me to a question.  While poking around in
> > ObjectSelect it occurred to me that the chaining API doesn’t appear to
> have
> > a “distinct” option.  If I were qualifying through a to-many relationship
> > will ObjectSelect just do the right thing and use a DISTINCT?
> >
> > -Lon
> >
> > On Wed, Dec 21, 2016 at 10:17 AM, Lon Varscsak <[hidden email]>
> > wrote:
> >
> >> Haha, yeah.  If only all problems solved themselves that way. :)
> >>
> >> On Tue, Dec 20, 2016 at 11:00 PM, Andrus Adamchik <
> [hidden email]>
> >> wrote:
> >>
> >>> Glad when the problems solve themselves by the time I finish reading a
> >>> thread :)
> >>>
> >>> Andrus
> >>>
> >>>> On Dec 20, 2016, at 6:18 PM, Lon Varscsak <[hidden email]>
> >>> wrote:
> >>>>
> >>>> And…turns out a problem in the model (to dependent PK missing). :P
> >>>>
> >>>> On Tue, Dec 20, 2016 at 8:00 AM, Lon Varscsak <[hidden email]
> >
> >>>> wrote:
> >>>>
> >>>>> Oops, I spoke too soon.  ObjectSelect isn’t my issue, it’s the
> firing a
> >>>>> to-one relationship…hmmm.
> >>>>>
> >>>>> -Lon
> >>>>>
> >>>>> On Tue, Dec 20, 2016 at 7:56 AM, Lon Varscsak <
> [hidden email]>
> >>>>> wrote:
> >>>>>
> >>>>>> Hey guys, is there any way to do an ObjectSelect and specify to not
> >>> use
> >>>>>> “DISTINCT”?  I have tables that have blob columns and Sybase doesn’t
> >>> allow
> >>>>>> distinct on them.
> >>>>>>
> >>>>>> Thanks,
> >>>>>>
> >>>>>> Lon
> >>>>>>
> >>>>>
> >>>>>
> >>>
> >>>
> >>
>
>
Loading...