RE: Duplicating an EO and all its relationships
RE: Duplicating an EO and all its relationships
- Subject: RE: Duplicating an EO and all its relationships
- From: "Albert Jagnow" <email@hidden>
- Date: Fri, 1 Aug 2003 10:30:36 -0500
- Priority: normal
- Thread-topic: Duplicating an EO and all its relationships
I was afraid this was going to be complicated. I guess that quote "if
it seems complicated you are not doing it right" is not always correct.
I found the code posted by Gary Teter on the Omni webobjects-dev mailing
list. If anyone else is looking for this code you can find it by doing
a search on "deepCopy" it was posted Dec 11 2001 with the somewhat odd
subject of "Cloning an WO in Java". Fortunately for me from my testing
so far I think this code is going to work pretty much exactly as posted.
My EOModel is setup so that the payment request owns its payment items,
but not the user, or requesting department objects (which I would not
want to duplicate). The payment items own their account numbers, but do
not own the actual account objects, or expense code and vendor objects
(which I would not want to duplicate). This code works well for my
situation as I do not have any objects that are not owned by the parent
eo that I would want to duplicate. So in the end I did only need to
write a few lines of code to make this work. Thanks for the help all.
--Albert
-----Original Message-----
From: Chuck Hill [mailto:email@hidden]
>
>Taking (my interpretation of) Albert's example, we have a complex PO
>that we want to use as a template for a new, very similar PO. We want
>to copy the the PO and PO items as brand new objects.
This is exactly what I was trying to do.
This e-mail (including any attachments) is covered by the Electronic
Communications Privacy Act, 18 USC. 2510-2521. It is confidential and
may be legally privileged. If you are not the intended recipient, you
are hereby notified that any retention, dissemination, distribution, or
copying of this communication is strictly prohibited. Please reply to
the sender that you have received the message in error, and then delete
it. Thank you.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.