You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Arseni Bulatski <ab...@objectstyle.com> on 2019/06/28 13:47:54 UTC

Deprecate SelectQuery in 4.2

Hi all,

SelectQuery is planned to be deprecated in 4.2.
ObjectSelect has better api and is recommended to use.

PR: https://issues.apache.org/jira/browse/CAY-2523

Please, write your thoughts about it.

Re: Deprecate SelectQuery in 4.2

Posted by John Huss <jo...@gmail.com>.
On Mon, Jul 1, 2019 at 11:29 AM Joe Baldwin <jf...@earthlink.net> wrote:

> Arseni,
>
> Disclaimer:
> I *just* (this week) upgraded from 4.0.M2 to 4.0.1.  I migrated to using
> the newer syntax - ex:
>
>         table1.property1.asc()
>
> > SelectQuery is planned to be deprecated in 4.2.
>
> My project makes extensive use of “.andExp” to perform
> conditional-expression-building.  So the only question I have is concerning
> discrete expression component building (ie. combining expression-components
> via “.andExp").  Would this be available or would it be deprecated as well?
>

ObjectSelect has a .and(Expression...) method that you can use. Or you can
use Expression.andExp(Expression...)


> BTW, I do like the newer syntax, as it it much easier to read and is less
> verbose.  Excellent work!
>
> Thanks
> Joe
>
>
> > On Jun 28, 2019, at 9:47 AM, Arseni Bulatski <ab...@objectstyle.com>
> wrote:
> >
> > Hi all,
> >
> > SelectQuery is planned to be deprecated in 4.2.
> > ObjectSelect has better api and is recommended to use.
> >
> > PR: https://issues.apache.org/jira/browse/CAY-2523
> >
> > Please, write your thoughts about it.
>
>

Re: Deprecate SelectQuery in 4.2

Posted by Joe Baldwin <jf...@earthlink.net>.
Arseni,

Disclaimer:
I *just* (this week) upgraded from 4.0.M2 to 4.0.1.  I migrated to using the newer syntax - ex:

	table1.property1.asc()

> SelectQuery is planned to be deprecated in 4.2.

My project makes extensive use of “.andExp” to perform conditional-expression-building.  So the only question I have is concerning discrete expression component building (ie. combining expression-components via “.andExp").  Would this be available or would it be deprecated as well? 

BTW, I do like the newer syntax, as it it much easier to read and is less verbose.  Excellent work!

Thanks
Joe


> On Jun 28, 2019, at 9:47 AM, Arseni Bulatski <ab...@objectstyle.com> wrote:
> 
> Hi all,
> 
> SelectQuery is planned to be deprecated in 4.2.
> ObjectSelect has better api and is recommended to use.
> 
> PR: https://issues.apache.org/jira/browse/CAY-2523
> 
> Please, write your thoughts about it.


Re: Deprecate SelectQuery in 4.2

Posted by John Huss <jo...@gmail.com>.
On Mon, Jul 1, 2019 at 2:24 PM Joe Baldwin <jf...@earthlink.net> wrote:

> Arseni,
>
> What is the ObjectSelect analog to
>
>         RefreshQuery
>

Not sure what equivalent for this one is.


> and
>         setCacheStrategy
>

ObjectSelect has .cacheStrategy(QueryCacheStrategy strategy, String
cacheGroup)


>
> Thanks
> Joe
>
>
> > On Jun 28, 2019, at 9:47 AM, Arseni Bulatski <ab...@objectstyle.com>
> wrote:
> >
> > Hi all,
> >
> > SelectQuery is planned to be deprecated in 4.2.
> > ObjectSelect has better api and is recommended to use.
> >
> > PR: https://issues.apache.org/jira/browse/CAY-2523
> >
> > Please, write your thoughts about it.
>
>

Re: Deprecate SelectQuery in 4.2

Posted by Andrus Adamchik <an...@objectstyle.org>.
> RefreshQuery is another type of query

I think that's the answer here. RefreshQuery is its own thing, and you can keep using it.

Andrus


> On Jul 2, 2019, at 10:05 AM, Arseni Bulatski <ab...@objectstyle.com> wrote:
> 
> Hi, Joe
> RefreshQuery is another type of query and is used to invalidate individual
> cache groups explicitly. To create ObjectSelect with similar behavior you
> can set cacheStrategy to QueryCacheStrategy.LOCAL_CACHE_REFRESH  or
> QueryCacheStrategy.SHARED_CACHE_REFRESH, depends on what type of cache you
> are using.
> Analog of setCacheStrategy for ObjectSelect is
> ObjectSelect.cacheStrategy(QueryCacheStrategy strategy).
> 
> On Mon, Jul 1, 2019 at 10:24 PM Joe Baldwin <jf...@earthlink.net> wrote:
> 
>> Arseni,
>> 
>> What is the ObjectSelect analog to
>> 
>>        RefreshQuery
>> and
>>        setCacheStrategy
>> 
>> Thanks
>> Joe
>> 
>> 
>>> On Jun 28, 2019, at 9:47 AM, Arseni Bulatski <ab...@objectstyle.com>
>> wrote:
>>> 
>>> Hi all,
>>> 
>>> SelectQuery is planned to be deprecated in 4.2.
>>> ObjectSelect has better api and is recommended to use.
>>> 
>>> PR: https://issues.apache.org/jira/browse/CAY-2523
>>> 
>>> Please, write your thoughts about it.
>> 
>> 


Re: Deprecate SelectQuery in 4.2

Posted by Arseni Bulatski <ab...@objectstyle.com>.
Hi, Joe
RefreshQuery is another type of query and is used to invalidate individual
cache groups explicitly. To create ObjectSelect with similar behavior you
can set cacheStrategy to QueryCacheStrategy.LOCAL_CACHE_REFRESH  or
QueryCacheStrategy.SHARED_CACHE_REFRESH, depends on what type of cache you
are using.
Analog of setCacheStrategy for ObjectSelect is
ObjectSelect.cacheStrategy(QueryCacheStrategy strategy).

On Mon, Jul 1, 2019 at 10:24 PM Joe Baldwin <jf...@earthlink.net> wrote:

> Arseni,
>
> What is the ObjectSelect analog to
>
>         RefreshQuery
> and
>         setCacheStrategy
>
> Thanks
> Joe
>
>
> > On Jun 28, 2019, at 9:47 AM, Arseni Bulatski <ab...@objectstyle.com>
> wrote:
> >
> > Hi all,
> >
> > SelectQuery is planned to be deprecated in 4.2.
> > ObjectSelect has better api and is recommended to use.
> >
> > PR: https://issues.apache.org/jira/browse/CAY-2523
> >
> > Please, write your thoughts about it.
>
>

Re: Deprecate SelectQuery in 4.2

Posted by Joe Baldwin <jf...@earthlink.net>.
Arseni,

What is the ObjectSelect analog to

	RefreshQuery
and
	setCacheStrategy

Thanks
Joe


> On Jun 28, 2019, at 9:47 AM, Arseni Bulatski <ab...@objectstyle.com> wrote:
> 
> Hi all,
> 
> SelectQuery is planned to be deprecated in 4.2.
> ObjectSelect has better api and is recommended to use.
> 
> PR: https://issues.apache.org/jira/browse/CAY-2523
> 
> Please, write your thoughts about it.


Re: Deprecate SelectQuery in 4.2

Posted by Arseni Bulatski <ab...@objectstyle.com>.
Thanks for comments.
Seems that there are no disagreements to mark SelectQuery as deprecated.
So I'll merge this PR.

On Thu, Jul 4, 2019 at 11:42 AM Andrus Adamchik <an...@objectstyle.org>
wrote:

> As deprecating SelectQuery has been on my TODO list for some time, let me
> share my thoughts... The motivation for the change is of course that we
> don't want to support two styles of queries at the same time. We are not a
> big team, and having the smallest possible maintenance footprint is
> important. There are other candidates for deprecation in the core API
> (ProcedureQuery, EJBQLQuery, SQLTemplate, and eventually - ROP). But
> SelectQuery is a good starting point, cause ObjectSelect is a fully capable
> replacement.
>
> Doesn't look like we have an argument against *deprecation*, so it would
> be great to do it ASAP, to announce loud and clear that the clock is
> ticking. We already missed this opportunity in 4.1, so I'd like to make it
> happen in 4.2.
>
> Now *removal* is another story, I agree. I don't think the LOE to switch
> is that great. Even the biggest codebase that I have is probably going to
> take me no more than 3-4 days to refactor. But still this was the core
> Cayenne API for many years, so the impact is non-trivial.
>
> So for now I suggest that we do the deprecation, and make the removal
> decision later (same way we did with Java upgrades and other breaking
> changes). I am thinking 5.0 release might be a good time and place to do
> it. So maybe not in 10 years, but in 2-3 years... But we'll review that
> again.
>
> Andrus
>
>
> > On Jul 4, 2019, at 8:45 AM, Aristedes Maniatis <ar...@maniatis.org> wrote:
> >
> >
> > On 28/6/19 11:47pm, Arseni Bulatski wrote:
> >> Hi all,
> >>
> >> SelectQuery is planned to be deprecated in 4.2.
> >> ObjectSelect has better api and is recommended to use.
> >>
> >> PR: https://issues.apache.org/jira/browse/CAY-2523
> >>
> >> Please, write your thoughts about it.
> >
> >
> > This is a pretty big change for many people. They would either not be
> able to upgrade to 4.3 ever, or else spend potentially a huge amount of
> time refactoring code. For my project, I'm guessing one person 4 weeks.
> >
> > Or are you suggesting it be marked as deprecated, but kept around until
> some important reason comes up to remove it. Perhaps 10 years from now when
> it is mostly forgotten.
> >
> >
> > Ari
> >
>
>

Re: Deprecate SelectQuery in 4.2

Posted by Andrus Adamchik <an...@objectstyle.org>.
As deprecating SelectQuery has been on my TODO list for some time, let me share my thoughts... The motivation for the change is of course that we don't want to support two styles of queries at the same time. We are not a big team, and having the smallest possible maintenance footprint is important. There are other candidates for deprecation in the core API (ProcedureQuery, EJBQLQuery, SQLTemplate, and eventually - ROP). But SelectQuery is a good starting point, cause ObjectSelect is a fully capable replacement.

Doesn't look like we have an argument against *deprecation*, so it would be great to do it ASAP, to announce loud and clear that the clock is ticking. We already missed this opportunity in 4.1, so I'd like to make it happen in 4.2.

Now *removal* is another story, I agree. I don't think the LOE to switch is that great. Even the biggest codebase that I have is probably going to take me no more than 3-4 days to refactor. But still this was the core Cayenne API for many years, so the impact is non-trivial. 

So for now I suggest that we do the deprecation, and make the removal decision later (same way we did with Java upgrades and other breaking changes). I am thinking 5.0 release might be a good time and place to do it. So maybe not in 10 years, but in 2-3 years... But we'll review that again.

Andrus


> On Jul 4, 2019, at 8:45 AM, Aristedes Maniatis <ar...@maniatis.org> wrote:
> 
> 
> On 28/6/19 11:47pm, Arseni Bulatski wrote:
>> Hi all,
>> 
>> SelectQuery is planned to be deprecated in 4.2.
>> ObjectSelect has better api and is recommended to use.
>> 
>> PR: https://issues.apache.org/jira/browse/CAY-2523
>> 
>> Please, write your thoughts about it.
> 
> 
> This is a pretty big change for many people. They would either not be able to upgrade to 4.3 ever, or else spend potentially a huge amount of time refactoring code. For my project, I'm guessing one person 4 weeks.
> 
> Or are you suggesting it be marked as deprecated, but kept around until some important reason comes up to remove it. Perhaps 10 years from now when it is mostly forgotten.
> 
> 
> Ari
> 


Re: Deprecate SelectQuery in 4.2

Posted by Aristedes Maniatis <ar...@maniatis.org>.
On 28/6/19 11:47pm, Arseni Bulatski wrote:
> Hi all,
>
> SelectQuery is planned to be deprecated in 4.2.
> ObjectSelect has better api and is recommended to use.
>
> PR: https://issues.apache.org/jira/browse/CAY-2523
>
> Please, write your thoughts about it.


This is a pretty big change for many people. They would either not be 
able to upgrade to 4.3 ever, or else spend potentially a huge amount of 
time refactoring code. For my project, I'm guessing one person 4 weeks.

Or are you suggesting it be marked as deprecated, but kept around until 
some important reason comes up to remove it. Perhaps 10 years from now 
when it is mostly forgotten.


Ari