ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kris A. Jenkins" <krisajenk...@yahoo.co.uk>
Subject Re: how does queryForMap work?
Date Wed, 30 Mar 2005 15:15:45 GMT
Steven,

SqlMap is trying to create a Map object to store the
results in, which of course it can't because it's
abstract.  For resultClass attributes, you can't use
the alias 'map', but instead have to specify
'java.util.HashMap' or your preferred Map
implementation.

HTH,
Kris

  
--- Steven Pannell <steven.pannell@zooplus.com> wrote:
> Hi,
> 
> I'm trying to use queryForMap but keep getting the
> following error (this is
> the first time I tried this):
> 
> 
> --- The error occurred while applying a result map. 
> 
> --- Check the getDiscount-AutoResultMap.  
> --- Check the result mapping for the 'PERCENTAGE'
> property.  
> --- Cause:
> com.ibatis.common.exception.NestedRuntimeException:
> JavaBeansDataExchange could not instantiate result
> class.  Cause:
> java.lang.InstantiationException: java.util.Map
> Caused by: java.lang.InstantiationException:
> java.util.Map
> Caused by:
> com.ibatis.common.exception.NestedRuntimeException:
> JavaBeansDataExchange could not instantiate result
> class.  Cause:
> java.lang.InstantiationException: java.util.Map
> 
> 
> My code and map are as follows:
> 
>         Map product2Discount =
>
client.queryForMap("getDiscountGroupProductDiscount",
> "myId", "productId");
> 
> 	<select id="getDiscountGroupProductDiscount"
> parameterClass="string"
> 		resultClass="map">
> 			select productId, percentage
> 			from discount 
> 			where myId = #myId#
> 	</select>
> 
> 
> Anyone have an idea what I did wrong??
> 
> THX
> Steve.
> 
> 

Send instant messages to your online friends http://uk.messenger.yahoo.com 

Mime
View raw message