ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Argan <arga...@yahoo.com.cn>
Subject Re: resultMap and HashMap
Date Thu, 06 Dec 2007 07:06:36 GMT

You can use queryForMap("STATEMENT-NAME",paramObj,"keyColumn","valueColumn")


bsterner wrote:
> 
> Well, if my result map was this...
> 
> <resultMap id="diaryResult" class="Map">
> 	<result property="diaryId" column="DiaryID"/>
> 	<result property="entryDate" column="EntryDate" jdbcType="DATE"
> javaType="java.util.Date"/>
> </resultMap>
> 
> The result is a hashmap with the following entries
> 
> diaryId => {DiaryID Value}
> entryDate => {Entry Date Value}
> 
> What I want is...
> 
> {DiaryID Value} => {Entry Date Value}
> 
> One of the columns makes the key, the other the value.  Would there be a
> way to do this with a custom type handler, if it cannot be done using the
> standard mapping rules?
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/resultMap-and-HashMap-tf4924592.html#a14187333
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message