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.varsc...@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

Reply via email to