You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Nathan Ward <nw...@resqsoft.com> on 2006/10/09 13:35:06 UTC

Re: Updating Multiple Tables per Single Root Object

Hello, 
 
I'm considering how best to update a list of objects referenced by a "root"
object. I see a discussion of this topic from July
(http://www.mail-archive.com/user-java@ibatis.apache.org/msg05237.html). 
 
In order to update the related tables, I suppose my DAO needs to query those
tables in order to compare to the in-memory list to figure out if objects
have been added and/or removed in order to know what operations need to be
done on those tables. Is that correct? I suppose this processing is why
Larry suggests that stored procedures for this would be faster. Is that
right?
 
   Nathan
 
Nathan Ward
ResQSoft, Inc.
703.861.9103
www.resqsoft.com
 

Re: Updating Multiple Tables per Single Root Object

Posted by Larry Meadors <lm...@apache.org>.
Yeah, that is why i was saying to use a stored procedure.

Also, remember that the UoW pattern will only detect your changes, not
changes someone else made in the database.

Larry


On 10/9/06, Nathan Ward <nw...@resqsoft.com> wrote:
>
>
> Looks like another option is to keep track of the changes with something
> like the Unit Of Work pattern in Patterns of Enterprise Architecture, by
> Martin Fowler. I'm thinking I'll try that route.
>
>    Nathan
>
>  ________________________________
>  From: Nathan Ward [mailto:nward@resqsoft.com]
> Sent: Monday, October 09, 2006 7:35 AM
> To: user-java@ibatis.apache.org
> Subject: Re: Updating Multiple Tables per Single Root Object
>
>
>
> Hello,
>
> I'm considering how best to update a list of objects referenced by a "root"
> object. I see a discussion of this topic from July
> (http://www.mail-archive.com/user-java@ibatis.apache.org/msg05237.html).
>
> In order to update the related tables, I suppose my DAO needs to query those
> tables in order to compare to the in-memory list to figure out if objects
> have been added and/or removed in order to know what operations need to be
> done on those tables. Is that correct? I suppose this processing is why
> Larry suggests that stored procedures for this would be faster. Is that
> right?
>
>    Nathan
>
> Nathan Ward
> ResQSoft, Inc.
> 703.861.9103
> www.resqsoft.com
>

RE: Updating Multiple Tables per Single Root Object

Posted by Nathan Ward <nw...@resqsoft.com>.
Looks like another option is to keep track of the changes with something
like the Unit Of Work pattern in Patterns of Enterprise Architecture, by
Martin Fowler. I'm thinking I'll try that route.
 
   Nathan

  _____  

From: Nathan Ward [mailto:nward@resqsoft.com] 
Sent: Monday, October 09, 2006 7:35 AM
To: user-java@ibatis.apache.org
Subject: Re: Updating Multiple Tables per Single Root Object


Hello, 
 
I'm considering how best to update a list of objects referenced by a "root"
object. I see a discussion of this topic from July
(http://www.mail-archive.com/user-java@ibatis.apache.org/msg05237.html). 
 
In order to update the related tables, I suppose my DAO needs to query those
tables in order to compare to the in-memory list to figure out if objects
have been added and/or removed in order to know what operations need to be
done on those tables. Is that correct? I suppose this processing is why
Larry suggests that stored procedures for this would be faster. Is that
right?
 
   Nathan
 
Nathan Ward
ResQSoft, Inc.
703.861.9103
www.resqsoft.com