ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: Converting ibator generated <iterate> clause in iBATIS 2 to iBATIS 3.0
Date Fri, 07 May 2010 14:11:08 GMT
There's nothing automatic.  The easiest thing to do is regenerate the
the code with the (as yet unreleased) new version of Ibator.  It's
very easy to build with Maven - I'm just struggling to find time to
deal with the all too cumbersome Apache release process.

I've done some thinking about an ibatis2->ibatis3 XML conversion tool
- but it's a very difficult thing to do because the dynamic SQL
elements are very different.  There's no easy answer for that.

Jeff Butler




On Thu, May 6, 2010 at 11:56 PM, Don's Email <don.clary@sbcglobal.net> wrote:
> I used ibator 1.2 to create the SQL mapper files for a project.  I am trying
> to convert the mapper files to iBATIS 3.0, but am stuck on the <iterate>
> tags.  Are there any examples available or a How to for converting mapper
> files to iBATIS 3.0?
>
>  <sql id="abatorgenerated_Example_Where_Clause">
>    <!--
>      WARNING - This element is automatically generated by Abator for
> iBATIS, do not modify.
>      This element was generated on Sat Oct 25 15:05:38 PDT 2008.
>    -->
>    <iterate conjunction="or" prepend="where" property="oredCriteria"
> removeFirstPrepend="iterate">
>      <isEqual compareValue="true" property="oredCriteria[].valid">
>        (
>        <iterate conjunction="and" prepend="and"
> property="oredCriteria[].criteriaWithoutValue">
>          $oredCriteria[].criteriaWithoutValue[]$
>        </iterate>
>        <iterate conjunction="and" prepend="and"
> property="oredCriteria[].criteriaWithSingleValue">
>          $oredCriteria[].criteriaWithSingleValue[].condition$
>            #oredCriteria[].criteriaWithSingleValue[].value#
>        </iterate>
>        <iterate conjunction="and" prepend="and"
> property="oredCriteria[].criteriaWithListValue">
>          $oredCriteria[].criteriaWithListValue[].condition$
>          <iterate close=")" conjunction="," open="("
> property="oredCriteria[].criteriaWithListValue[].values">
>            #oredCriteria[].criteriaWithListValue[].values[]#
>          </iterate>
>        </iterate>
>        <iterate conjunction="and" prepend="and"
> property="oredCriteria[].criteriaWithBetweenValue">
>          $oredCriteria[].criteriaWithBetweenValue[].condition$
>          #oredCriteria[].criteriaWithBetweenValue[].values[0]# and
>          #oredCriteria[].criteriaWithBetweenValue[].values[1]#
>        </iterate>
>        )
>      </isEqual>
>    </iterate>
>  </sql>
>
> Thank you!
>
> Don
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message