ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: Single column select
Date Thu, 23 Nov 2006 14:17:37 GMT
<select id="gah" resultclass="int">
select blah as value from sometable
</select>

On 11/23/06, c.zecca@ads.it <c.zecca@ads.it> wrote:
>
>
> Hi all
>
>  let's consider a very simple select whose purpose is to extract a column of
> basic type.
>  E.g.
>
>  select MY_COLUMN
>  from MY_TABLE
>
>  for a list of values such as...
>
>  24
>  19
>  20
>  24
>  30
>  25
>  ...
>  ( a set if the distinct specification would be used)
>
>  (MY_COLUMN in this case is either of INTEGER or NUMERIC type)
>  How should I define the SQL map?
>  I've just read the "Implicit Result Maps" in the developer guide but I have
> not found any similar example (single column selection). All examples report
> cases of
>
>  select *
>
>  or
>
>  select COLUMN_1, COLUMN_2, ...
>
>
>  It's not a primitive result but, instead, a list (or set) of primitive
> results.
>  Instinctively I would exclude an HashMap, because, definitively, return
> values are not named and cannot be accessed via keys.
>
>  Should I anyway define a single property class / result map and use it
> along with queryForList?
>  Or is there any simpler way?
>
>  ciao

Mime
View raw message