On Wed, Jun 24, 2009 at 4:22 PM, Roger <[email protected]> wrote:

>  is there a way
> through the "enhanced" version to detect which entities have been changed
> so I
> don't call persist() for them,


Well, since no one else has replied, I might be able to help. Try this:
OpenJPAEntityManager openJpaEm = (OpenJPAEntityManager) em;
assertTrue(openJpaEm.isDirty(entity));


> or do I persist() them all and trust openJpa to
> only physically persist entities that have changed?
>

First I assume you mean merge() rather than persist() as persist() is
something you do with new entities.

I don't know the answer to the second part, but I would assume the em would
check isDirty first before merging. If not, then it must be doing more
in-depth checks which means isDirty is not sufficient (so what is it good
for, then)? Since the merge may be cascading, maybe isDirty checks only the
parent entity? Can the experts set this straight?

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:[email protected]

Reply via email to