The way to deal with this situation in Flextrine is to use the
detach/detachCopy and merge methods. For example, this is how I would
implement a popup with a save and cancel button (which is quite similar
to your use case).
Supposing the the popup happens to edit a managed entity called
managedEntity, I would first do:
detachedEntity = em.detachCopy(managedEntity)
This gives me a complete copy of managedEntity, but the crucial thing is
that this entity is now detached, which means that I can make changes to
it without anything getting added to the UnitOfWork. On-demand loading
and bi-directional association management should still work on the
detached entity.
When I want to save the entity I do:
em.merge(detachedEntity);
em.flush();
Note that this is very recent functionality, so you'll need to work off
the master branch to get this feature.
Good luck!
Dave Keen
http://www.actionscriptdeveloper.co.uk
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1375 / Virus Database: 1500/3635 - Release Date: 05/13/11
>
>
Cheers,
Dave
Simon Vanherweghe <simon.va...@gmail.com> wrote:
--
Sent from my Android phone with K-9 Mail.