ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c.ze...@ads.it
Subject Single column select
Date Thu, 23 Nov 2006 14:11:10 GMT

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