To do a
proper clone, you need to deep copy, that means walking the relationships and
cloning each of them.
EclipseLink's
cloning does backup clone and working copy cloning, and also is optimized to
stop at untriggered relationships. That is likely the complexity that you
are referring to.
Note: that
with weaving change tracking enabled, clones are not usually required, as we
track the changes in place.
I hope that
this answer is helpful.
Good
luck.
Peter
Hi
all,
this may be a little strange question, but still. I study at
the Czech Technical University and my bachelor's project is transactional
processing for a persistence layer developed at the university. This layer
control access to ontologies, not relational databases. I got inspired by the
EclipseLink and here's my question:
Can you, please, give me a little
advice about cloning objects? I've developed the Unit of Work system, quite
similar to the one in EclipseLink (but much simpler), but the way EclipseLink
creates clones is quite complex. Is there an easier way to clone objects? I
understand that making shallow copies won't work, but I don't know how to
solve relationships when cloning. Should I clone all the objects the given one
is in relationship with? Or is there another solution?
Thanks very
much
Martin Ledvinka
|