Hi, 

I'm having a problem when performing a join to a property which is an
IDictionary<int, [type]>. Hope you can help. 

I'm getting the following error: 

failed: Error on Result property UserProviderData, type handler for
IDictionary`2 is not
registered.IBatisNet.DataMapper.Exceptions.DataMapperException: Error on
Result property UserProviderData, type handler for IDictionary`2 is not
registered.

I have the following classes: 

public class User : IComparable
{
     
        public int Id { get; set; }
        public IDictionary<int, ProviderUserData> UserProviderData { get;
set; }
        ....
}

public class ProviderUserData
{
        public int Id { get; set; }
        public int ProviderUserId { get; set; }        
        public int Provider { get; set; }
}

Mapping

<resultMaps>
   <resultMap id="UserMap" class="User">
    <result property="Id" column="Id"/>
    <result property="UserId" column="UserId"/>
    <result property="UserProviderData"
resultMap="UserProviderDataHashMap"/>
   </resultMap>

    <resultMap id="UserProviderDataHashMap" class="Hashtable">
      <result property="ProviderId" column="ProviderId"/>
      <result property="UserProviderData" resultMap="UserProviderDataMap"/>
    </resultMap>
    
    <resultMap id="UserProviderDataMap" class="ProviderUserData">
      <result property="Id" column="Id"/>
      <result property="ProviderUserId" column="ProviderUserId"/>
      <result property="Provider" column="ProviderId"/>
    </resultMap>


  </resultMaps>
  <statements>    
    <sql id="UserSelect">
      SELECT u.Id, u.UserId, u.FirstName, u.LastName, u.MSN, u.Phone,
u.IsAdmin, u.IsProjectManager, u.IsAccountManager, u.Active, u.Created,
u.LastLogin, u.WorkWeek,
             up.Id as UpId, up.ProviderId, up.ProviderUserId
      FROM [Users] u
      LEFT OUTER JOIN [UserProvider] up on u.id = up.userid
    </sql>
    
    <select id="FindUser"  parameterClass="UserMapByUserId"
resultMap="UserMap">
      <include refid="UserSelect"/>
      Where 
      <dynamic>
         <iterate property="UserId" open="u.UserId in (" close=")"
conjunction=",">#UserId[]#</iterate>
      </dynamic>
 </select>

As you can see I'm attempting to do a join where the result should be
entered into an IDictionary<> however it does not seem to understand the
IDictionary type. 

Any help is greatly appreciated. 

-- 
View this message in context: 
http://www.nabble.com/Join-problem-tp25167492p25167492.html
Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-cs-unsubscr...@ibatis.apache.org
For additional commands, e-mail: user-cs-h...@ibatis.apache.org

Reply via email to