ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick <ric...@gmail.com>
Subject Re: Define Hashmap
Date Mon, 01 Dec 2008 21:09:28 GMT
2008/12/1 John Chien <john.chien@ncmail.net>

> Dear sir:
>
> This is my first time of using HashMap.
> I defined the following structure and statement.
>
> Are they correct ?
> What is the key for the HashMap ?
>
> <resultMap id="facilityIdBEAN" class="java.util.HashMap">
>    <result property="facilityId"      column="facility_id",
>    <result property="countyId"      column="county",
>    <result property="facilityType"  column="type",
>    <result property="seqNo"         column="seq_no"
>  </resultMap>
>
>
>  <statement id="getCountyFacilityMap" parameterClass="java.util.String"
> resultMap="facilityIdBEAN">
>    SELECT LPAD(COUNTY_ID, 3,'0') || LPAD(FAC_TYPE, 2,'0') ||
> LPAD(FAC_ID_NUMBER, 4,'0') as facility_id,
>           COUNTY_ID
>                                                                           as
> county,
>           FAC_TYPE
>
>   as type,
>           FAC_ID_NUMBER
>                                                                      as
> seq_no
>    FROM   EH.BETS_FACILITY
>    WHERE  COUNTY_ID = #value#
>  </statement>
>
> Thanks,
>


The map keys will be your property fields you defined in your facilityIdBEAN
resultMap.

Mime
View raw message