Re: ERXGenericRecord call didUpdate on insert object
Paul Hoadley <[email protected]> Tue, 10 Mar 2015 09:04:10 +1030
| Newsgroups | gmane.comp.web.webobjects.wonder-disc |
|---|---|
| Message-ID | <[email protected]> |
--===============0013141458810697677== Content-Type: multipart/alternative; boundary="Apple-Mail=_AFCC52CA-0E84-4548-96DF-5AA6BCDEDAF3" --Apple-Mail=_AFCC52CA-0E84-4548-96DF-5AA6BCDEDAF3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Daniele, On 10 Mar 2015, at 2:52 am, Daniele Corti <[email protected]> wrote: > No problem in implementation, but, when I create a new object, I've = noticed that the method didUpdate() is called before didInsert(), so = creating an entry in DB, perform an Update log and a Insert log. = However, deleting the Record does not call the didUpdate method, just = the didDelete. >=20 > It is supposed to do this? That's certainly what it _does_, yes. So you're not going crazy, and = nothing is broken. > The didUpdate documentation say: > Called on the object after is has successfully been updated in the = database. But the Object is Inserted not Updated, so I don't understand = very well the working of this... >=20 I agree that the documentation is poor. You might argue that the = database itself has been "updated" after the insertion, but I think that = would be confusingly loose language given that there exists an UPDATE = SQL statement, and it hasn't been used in the case of inserting a new = object. > Anyway, if this is the normal behavior in EOGenericRecord lifecycle, = is there a way to notice that the didUpdate method is called on a = inserted object, or another method must be used in order to do this? >=20 willUpdate() is called prior to an actual UPDATE (and not prior to an = INSERT). Would this help? --=20 Paul Hoadley http://logicsquad.net/ --Apple-Mail=_AFCC52CA-0E84-4548-96DF-5AA6BCDEDAF3 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi = Daniele,<div><br><div><div>On 10 Mar 2015, at 2:52 am, Daniele Corti = <<a href=3D"mailto:[email protected]">[email protected]</a>> = wrote:</div><br class=3D"Apple-interchange-newline"><blockquote = type=3D"cite"><div dir=3D"ltr"><div>No problem in implementation, but, = when I create a new object, I've noticed that the method didUpdate() is = called before didInsert(), so creating an entry in DB, perform an Update = log and a Insert log. However, deleting the Record does not call the = didUpdate method, just the didDelete.</div><div><br></div><div>It is = supposed to do this?</div></div></blockquote><div><br></div><div>That's = certainly what it _does_, yes. So you're not going crazy, and = nothing is broken.</div><div><br></div><blockquote type=3D"cite"><div = dir=3D"ltr"><div> The didUpdate documentation say:</div><div><p = class=3D""><span class=3D"">Called on the object after is has = successfully been updated in the database. But the Object is Inserted = not Updated, so I don't understand very well the working of = this...</span></p></div></div></blockquote><div><br></div><div>I agree = that the documentation is poor. You might argue that the database = itself has been "updated" after the insertion, but I think that would be = confusingly loose language given that there exists an UPDATE SQL = statement, and it hasn't been used in the case of inserting a new = object.</div><div><br></div><blockquote type=3D"cite"><div = dir=3D"ltr"><div><p class=3D"">Anyway, if this is the normal behavior in = EOGenericRecord lifecycle, is there a way to notice that the didUpdate = method is called on a inserted object, or another method must be used in = order to do = this?</p></div></div></blockquote><div><br></div><div>willUpdate() is = called prior to an actual UPDATE (and not prior to an INSERT). = Would this help?</div><div><br></div><div><br></div></div><div = apple-content-edited=3D"true"> <span class=3D"Apple-style-span" style=3D"border-collapse: separate; = border-spacing: 0px;"><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = 'Lucida Grande'; font-style: normal; font-variant: normal; font-weight: = normal; letter-spacing: normal; line-height: normal; orphans: 2; = text-indent: 0px; text-transform: none; white-space: normal; widows: 2; = word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = 'Lucida Grande'; font-style: normal; font-variant: normal; font-weight: = normal; letter-spacing: normal; line-height: normal; orphans: 2; = text-indent: 0px; text-transform: none; white-space: normal; widows: 2; = word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; ">-- <br>Paul Hoadley<br><a = href=3D"http://logicsquad.net/">http://logicsquad.net/</a><br><br></div></= span></div></span></span> </div> <br></div></body></html>= --Apple-Mail=_AFCC52CA-0E84-4548-96DF-5AA6BCDEDAF3-- --===============0013141458810697677== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ --===============0013141458810697677== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Wonder-disc mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wonder-disc --===============0013141458810697677==--