cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jurgen" <do...@xsinet.co.za>
Subject Re: Finding an object in an ObjectContext
Date Thu, 16 Aug 2018 09:24:01 GMT
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
View raw message