Ah... I hadn't considered that the Address was already aware of its parent. Dealing with the Address object directly was less painful. :)
With regard to cloning... isn't that the only way to do it? :o) My validation mechanism occurs once the Transfer Object has been populated. I don't want the (potentially) invalid form data to dirty the cache until it has been validated. If the object doesn't validate, I pass the entire object back to the form to output errors. Jason On Mon, Nov 2, 2009 at 2:06 PM, Jason Durham <[email protected]> wrote: > Ah... I hadn't considered that the Address was already aware of its > parent. Dealing with the Address object directly was less painful. :) > > With regard to cloning... isn't that the only way to do it? :o) My > validation mechanism occurs once the Transfer Object has been populated. I > don't want the (potentially) invalid form data to dirty the cache until it > has been validated. If the object doesn't validate, I pass the entire > object back to the form to output errors. > > Jason > > > > > On Mon, Nov 2, 2009 at 1:46 PM, Tom McNeer <[email protected]> wrote: > >> You're headed in the right direction, looking to use the composed >> relationships. But ... >> >> On Mon, Nov 2, 2009 at 2:19 PM, <[email protected]> wrote: >> >>> My first exercise in saving an Address, did so without regard of the >>> CompanyID. Essentially, the handler took the AddressID, located the correct >>> Transfer Object, cloned it, populated, validated and saved the Address >>> without any knowledge of a Company. This seemed to be working fine. >>> >> >> ... if you are working with a database record that currently exists and >> has the Company relationship attached, you don't need to deal with the >> Company at all. The Address object knows what its parent Company is, and if >> you don't need to change it, then you don't have to mess with it at all. >> >> For a new record, you'd need to use the CompanyID to retrieve the Company >> object, then do Address.setParentCompany(myCompany), or something like that, >> before saving the Address record. >> >> But if the Address already has a Company, most times you can just ignore >> it. (Unless of course, you actually need the Company for another reason.) >> >> But why did you need to clone the object? >> >> >> Thanks, >> >> Tom >> >> Tom McNeer >> MediumCool >> http://www.mediumcool.com >> 1735 Johnson Road NE >> Atlanta, GA 30306 >> 404.589.0560 >> >> >> >> > > > -- > Jason Durham > -- Jason Durham --~--~---------~--~----~------------~-------~--~----~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups "transfer-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~----------~----~----~----~------~----~------~--~---
