Been a while and haven't had a response on this. My workaround is below,
basically duplicate selects, one that gets called from the resultMap and
one that gets called from the DAO; exact same except for the
parameterClass. 

Does anyone have a better way to this? I'd rather not have double the
number of selects!

 

1. Select called from resultMap with composite keys

 

<select id="getCompanyTypeByIdAndLocale"
           resultMap="select-company-type-result">
  select ...
</select>

 

2. Select called from DAO, with Map as parameterClass 

 

<select id="getCompanyTypeByIdAndLocale2"

           parameterClass="java.util.Map"
           resultMap="select-company-type-result">
  select ...
</select>

 

Thanks,

Darren

________________________________

From: Darren Moen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 18, 2007 12:30 AM
To: [email protected]
Subject: parameterClass for select from resultMap with composite keys

 

 

I have a result map that does a result select based on 2 columns

<result property="companyType"
           column="lookupId=company_type_id,localeId=locale_id"
           select="getCompanyTypeByIdAndLocale"/>

The select works fine when done from the result map when NO
parameterClass is specified

<select id="getCompanyTypeByIdAndLocale"
           resultMap="select-company-type-result">
  select ...
</select>

But then I can't reuse that select statement from my DAO because it
needs 2 parameters, but if I pass in a map it complains because it was
expecting a String (because no paramaterClass was specified)

If I specify a parameterClass='java.util.Map' I get a error:
--- Check the result mapping for the 'companyType' property.
--- Cause: java.sql.SQLException: Column
'lookupId=company_type_id,localeId=locale_id' not found.


I know I could easily have 2 select statements, but hopefully that's not
necessary.
Any help would be appreciated. 

Reply via email to