ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Maves <Nathan.Ma...@Sun.COM>
Subject Re: dynamic sql map
Date Thu, 12 Jan 2006 15:05:34 GMT
You are asking us if your code works?

A few things I might change...

1. change your <statement> tag to a <select>
2. add a parameter class attribute to the select
3. If you are going to have different numbers of columns selected  
then you need to set reMapResults = true.

This is really the lazy mans way to things.  How hard is it to copy  
and paste your sqlMap and create a new one with different columns and  
a unique name?


Nathan

On Jan 12, 2006, at 6:05 AM, Henry Lu wrote:

> Is this sql mapping works in the IBATIS?
>
> <statement id="select_list" resultClass="domain.NameValue">
> select $list_cols$
> FROM $table_name$
> </statement>
>
> Map map = new HashMap(2);
>       map.put("list_cols", "STATE_ABBRV, STATE");
>       map.put("table_name", "USSTATE_DESC");
>
>       return getSqlMapClientTemplate().queryForList(
>                "select_list", map);
>
> -Henry
>


Mime
View raw message