You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Lon Varscsak <lo...@gmail.com> on 2016/12/20 14:56:24 UTC
ObjectSelect without DISTINCT
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
Re: ObjectSelect without DISTINCT
Posted by Lon Varscsak <lo...@gmail.com>.
Gotcha, sounds good.
-Lon
On Wed, Dec 21, 2016 at 11:24 PM, Andrus Adamchik <an...@objectstyle.org>
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 <lo...@gmail.com>
> 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 <lo...@gmail.com>
> > wrote:
> >
> >> Haha, yeah. If only all problems solved themselves that way. :)
> >>
> >> On Tue, Dec 20, 2016 at 11:00 PM, Andrus Adamchik <
> andrus@objectstyle.org>
> >> 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 <lo...@gmail.com>
> >>> 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 <lon.varscsak@gmail.com
> >
> >>>> 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 <
> lon.varscsak@gmail.com>
> >>>>> 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
> >>>>>>
> >>>>>
> >>>>>
> >>>
> >>>
> >>
>
>
Re: ObjectSelect without DISTINCT
Posted by Andrus Adamchik <an...@objectstyle.org>.
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 <lo...@gmail.com> 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 <lo...@gmail.com>
> wrote:
>
>> Haha, yeah. If only all problems solved themselves that way. :)
>>
>> On Tue, Dec 20, 2016 at 11:00 PM, Andrus Adamchik <an...@objectstyle.org>
>> 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 <lo...@gmail.com>
>>> 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 <lo...@gmail.com>
>>>> 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 <lo...@gmail.com>
>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>
>>>
>>
Re: ObjectSelect without DISTINCT
Posted by Lon Varscsak <lo...@gmail.com>.
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 <lo...@gmail.com>
wrote:
> Haha, yeah. If only all problems solved themselves that way. :)
>
> On Tue, Dec 20, 2016 at 11:00 PM, Andrus Adamchik <an...@objectstyle.org>
> 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 <lo...@gmail.com>
>> 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 <lo...@gmail.com>
>> > 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 <lo...@gmail.com>
>> >> 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
>> >>>
>> >>
>> >>
>>
>>
>
Re: ObjectSelect without DISTINCT
Posted by Lon Varscsak <lo...@gmail.com>.
Haha, yeah. If only all problems solved themselves that way. :)
On Tue, Dec 20, 2016 at 11:00 PM, Andrus Adamchik <an...@objectstyle.org>
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 <lo...@gmail.com>
> 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 <lo...@gmail.com>
> > 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 <lo...@gmail.com>
> >> 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
> >>>
> >>
> >>
>
>
Re: ObjectSelect without DISTINCT
Posted by Andrus Adamchik <an...@objectstyle.org>.
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 <lo...@gmail.com> 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 <lo...@gmail.com>
> 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 <lo...@gmail.com>
>> 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
>>>
>>
>>
Re: ObjectSelect without DISTINCT
Posted by Lon Varscsak <lo...@gmail.com>.
And…turns out a problem in the model (to dependent PK missing). :P
On Tue, Dec 20, 2016 at 8:00 AM, Lon Varscsak <lo...@gmail.com>
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 <lo...@gmail.com>
> 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
>>
>
>
Re: ObjectSelect without DISTINCT
Posted by Lon Varscsak <lo...@gmail.com>.
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 <lo...@gmail.com>
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
>