ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashanth Sukumaran <prashanthsukuma...@yahoo.com>
Subject Re: referencing complex POJO properties for parameters in inserts
Date Wed, 26 Jan 2005 13:44:21 GMT
Hi Andrew,

Why don't you just loop outside in your dao and execute batch?  It is just a simple for-loop.


--- Andrew Fooks <a.fooks@qut.edu.au> wrote:

> Hi team,
>  Just trying to get some clarification on this, as it's a bit of a
>  puzzler to me.  I've trawled through the mail archive and I haven't
>  really been able to get anything that looks remotely similar to work.  
> My example is:
>  I have a JavaBean which is my base bean.  A property of that JavaBean is
>  a List, which contains a list of other JavaBeans.  All properies (for both
> beans) are Strings.  I'm trying to write an insert that will insert a row in a
>  table with the same key in the base bean with the different data pulled
>  out of the JavaBeans in the List.
>  I thought it would be something like:
>  Base Bean:
>  private String scriptName;
>  //getters and setters
>  JavaBean from the List of Beans:
>  private String sequence;
>  private String sql;
>  //getters and setters
>  <statement id="insertBot" parameterClass="bot">
>      <dynamic>
>          <iterate property="sqlList">
>              insert into BOTS (NAME, SQL, SEQUENCE)
>              values (#scriptName#, #sqlList[].sql#, #sqlList[].sequence#)
>          </iterate>
>      </dynamic>
>  </statement>
>  Clinton has said that the iterate tag isn't really designed for the above usage, so
I guess
> it's time to refactor.  Anyone have any suggestions?
> Thanks,
>  Andrew

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

View raw message