ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn Hinsey" <Shawn.Hin...@miva.com>
Subject List class question
Date Tue, 23 May 2006 21:06:42 GMT
Given the following result map and select statements it seems like my
ConfigurationModel object's Settings property, which is a
ConfigurationSettingCollection object, should be populated correctly,
but instead I get an error that you can't assign a ConfigurationSetting
object to a ConfigurationSettingCollection type. What am I missing? 

The collection class implements Ienumerable and Icollection rather than
using CollectionBase, but I'm not sure if that would matter.
ConfigurationModel is a poco. 

		<resultMap class="ConfigurationModel"
id="configurationModel">
			<result column="Id" property="Id"/>
			<result column="Version" property="Version"/>
			<result column="Site" property="Site"/>
			<result property="Settings" column="Id"
select="loadConfigSettings"/>
		</resultMap>

		<select id="loadConfigSite"
resultMap="configurationModel">
			SELECT * FROM ConfigurationModel WHERE Site =
#VALUE#
		</select>

		<select id="loadConfigSettings"
resultClass="ConfigurationSetting" 
	
listClass="ConfigurationSettingCollection">
			SELECT * FROM ConfigurationSetting WHERE
ConfigurationModelId = #VALUE#
		</select>

Thanks in advance,
Shawn

Mime
View raw message