Anthony,
I am reviving this issue again because I am wondering what must take
place on the persistence side to save my user and all of the addresses
related to it?
In other words, once I have done user.set("addresses",addresses); how
do I turn around and do user.save() to persist all of the addresses?
Must I add some business logic in my userDAO to loop through the
addresses and persist them?
Thanks,
Aaron
On 3/21/07, Anthony Israel-Davis <[EMAIL PROTECTED]> wrote:
In that scenario, what I would do is something like:
addresses = createObject("component","AddressIBO").init();
addresses.loadQuery(query);
user.set('addresses',addresses);
You've created an address object that now can be a property of the user
object ("composition" in OO speak)
Now you can do this:
a = user.get('addresses');
While (a.hasNext()) {
doSomethingToA(a);
}
BTW, I created a hasNext() method which is similar to isLast() but
checks whether iterator is GT than numRecords. It made more sense in
while loops.
I'm also planning on adding "add" and "remove" methods, but I haven't
needed them (yet) but now I'm off-topic ;-)
Anthony
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]