cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lon Varscsak <lon.varsc...@gmail.com>
Subject Re: Finding an object in an ObjectContext
Date Mon, 20 Aug 2018 17:54:41 GMT
Okay, thanks!

On Thu, Aug 16, 2018 at 2:24 AM Jurgen <dollj@xsinet.co.za> wrote:

> I think you can kinda "query" the inserted objects using an Expression, eg:
>
> Expression  filter = ExpressionFactory.likeExp( FooClass.FOO_PROPERTY,
> "\\Q"+ text +"\\E" );
> FooClass  match = filter.<FooClass>first( (List<FooClass>)
> getObjectContext().newObjects() );
> if ( match != null )  .....
>
> Jurgen
>
> -----Original Message-----
> From: Andrus Adamchik
> Sent: Thursday, August 16, 2018 9:38 AM
> To: user@cayenne.apache.org
> Subject: Re: Finding an object in an ObjectContext
>
> > or should I just parse through newObjects()?
>
> Yes.
>
> Andrus
>
> > On Aug 16, 2018, at 2:25 AM, Lon Varscsak <lon.varscsak@gmail.com>
> wrote:
> >
> > I have a situation where I need to query the inserted objects in an
> > ObjectContext to see if there's one already created.  I know this is an
> > odd
> > situation, but is there a way to accomplish this or should I just parse
> > through newObjects()?
> >
> > Thanks,
> >
> > Lon
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message