Reformat iBATIS XML Files

The SQL in iBATIS files doesn't get reformatted very well.
e.g. this is formatted by IDEA

    <select id="selectRange" parameterClass="com.me.FilteredSortedRange" resultClass="com.me.Response">
        select * from (
        select ROWNUM num, a.* from (
        select * from (
        <include refid="statusresponse.selectAgg"/>
        )
        ) a
        )
        <include refid="statusresponse.filterWhereRange"/>
        <include refid="statusresponse.orderBy"/>
    </select>


whereas this makes the query clearer as you can see the nested SQL blocks

    <select id="selectRange" parameterClass="com.me.FilteredSortedRange" resultClass="com.me.Response">
        select * from (
            select ROWNUM num, a.* from (
                select * from (
                    <include refid="statusresponse.selectAgg"/>
                )
            ) a
        )
        <include refid="statusresponse.filterWhereRange"/>
        <include refid="statusresponse.orderBy"/>
    </select>


How do I configure this?

2 comments
Comment actions Permalink

Please file a ticket.

On 10.07.2010 0:15, opticyclic wrote:

The SQL in iBATIS files doesn't get reformatted very well.
e.g. this is formatted by IDEA

>          select * from (
>          select ROWNUM num, a.* from (
>          select * from (
>          
>          )
>          ) a
>          )
>          
>          
>      ]]>

>

whereas this makes the query clearer as you can see the nested SQL blocks

>

<select id="selectRange" parameterClass="com.me.FilteredSortedRange" resultClass="com.me.Response">
         select * from (
             select ROWNUM num, a.* from (
                 select * from (
                     <include refid="statusresponse.selectAgg"/>
                 )
             ) a
         )
         <include refid="statusresponse.filterWhereRange"/>
         <include refid="statusresponse.orderBy"/>
     </select>

 ]]>

>

How do I configure this?

>

---
Original message URL: http://devnet.jetbrains.net/message/5267402#5267402


0

Please sign in to leave a comment.