| Newsgroups |
gmane.comp.java.cayenne.user |
| Message-ID |
<CAAOOpAN4SoiJb2aY5R3z16KV1tzQUV0rmTC9LC0rfXyaWo4=tg@mail.gmail.com> |
Thanks Andrus!
I'll report on any progress with my upgrade.
Giulio Cesare
On Tue, Sep 30, 2025 at 2:26=E2=80=AFPM Andrus Adamchik <[email protected]=
m> wrote:
>
> Hi Giulio,
>
> SelectQuery is replaced with ObjectSelect. But in your case (a query mode=
led in the DataMap), you would actually use something else - a MappedSelect=
query per https://cayenne.apache.org/docs/4.2/cayenne-guide/#mappedselect-=
and-mappedexec
>
> MappedSelect.query("attachment", Attachment.class)
> .param("reference", aReference)
> .param("user", anUser)
> .select(context);
>
> Thanks,
> Andrus
>
>
> > On Sep 30, 2025, at 3:15=E2=80=AFAM, [email protected] wrote:
> >
> > Hello everybody,
> >
> > even if this will force me to admit how old I am, I still have some
> > Cayenne 3.0.2 code happily running in production with no issues.
> >
> > Lately I was trying to upgrade the application from a WAR (running in
> > Tomcat) to a standalone application exposing the servlets via Jetty,
> > in order to make the application easier to deploy in a docker
> > container.
> >
> > After some struggle to update the model, I am now facing a LOT of
> > deprecation warnings like this:
> >> [deprecation] SelectQuery in org.apache.cayenne.query has been depreca=
ted
> >
> > The code I have looks like this:
> > -------------------
> > prototypeQuery =3D
> > (SelectQuery)dataContext.getEntityResolver().lookupQuery("attachment");
> >
> > parameters =3D new HashMap();
> > parameters.put("reference", aReference);
> > parameters.put("user", anUser);
> > query =3D prototypeQuery.queryWithParameters(parameters);
> >
> > result =3D (List<Attachment>)dataContext.performQuery(query);
> > -------------------
> >
> > Unfortunately I never had the opportunity to use any newer version of
> > Cayenne, so I haven't followed along with all the changes that it has
> > gone through.
> >
> > Is there anyone willing to suggest me what the above code snippet
> > would look like with the new version of Cayenne?
> >
> > Thanks,
> >
> > Giulio Cesare
>