ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno Silva (Cool Advance)" <bruno.si...@cooladvance.com>
Subject Re: IBatis.NET release
Date Mon, 11 Dec 2006 17:13:23 GMT
Hi,

I've been trying to use the groupBy feature available in the trunk and 
it works great. However, I haven't managed to have the right results for 
maps that return a primitive.

These are the result maps:

*<resultMap id="Fields.ResultMap" class="Field">
      <result property="Id" column="id"  />
      <result property="Name" column="name" />
      <result property="Description" column="description" />
      <result property="FieldType" column="field_type"/>
    </resultMap>

    <resultMap id="Fields.Fill.ResultMap" class="Field" 
extends="Fields.ResultMap" groupBy="Id">
      <result property="PossibleValues" column="value_text" 
resultMapping="Fields.PossibleValues.ResultMap" />
    </resultMap>

    <resultMap id="Fields.PossibleValues.ResultMap" class="string">
      <result property="value" column="value_text" />
    </resultMap>*

and here is the statement:

*<select id="Select.Fields.Fill" resultMap="Fields.Fill.ResultMap" 
parameterClass="string">
      SELECT
      f.*, pv.value_text
      FROM fields f
      LEFT JOIN possible_values pv ON f.id = pv.field_id
      <isParameterPresent>
        WHERE f.id = #value#
      </isParameterPresent>
    </select>
*
It actually groups the results correctly (2 inserted entries return 2 
rows) but I get empty strings instead of the correct values.
Where did I go wrong, or is this is a bug?

Thanks in advance,
  Bruno Silva

-- 
Cool Advance - Information Systems
http://www.cooladvance.com/


Mime
View raw message