ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: Saving a list
Date Wed, 22 Jun 2005 19:49:34 GMT
1 line of code versus 4. Doesn't appear to be a big issue. Simply wrap
it in a transaction and have at it.

Brandon

On 6/22/05, Paulo Neves <igod.pt@gmail.com> wrote:
> Hi all,
> 
> I'm doing an application using iBatis.
> My question is, is possible to save a list ?
> 
> Example:
> business objs:
> class Relation {
>     Integer relId;
>     String name;
> }
> 
> 
> class Contact {
>     Integer contactId;
>     String name;
>     ...
>     List relationsList;
> }
> 
> How can I save one  contact that could have a relationsList with only
> one step like
> 
> sqlMap.insert("addContact",contact);
> 
> and not
> 
> sqlMap.insert("addContact",contact);
> for(int i=0;i,contact.relationsList.size();i++) {
>     sqlMap("addContactRelation",contact.relationsList.get(i));
> }
> 
> Thanks,
> Paulo
>

Mime
View raw message