You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Samnang Chhun <sa...@gmail.com> on 2007/07/25 11:27:29 UTC

Constuctor with GroupBy Problem

Hi,

 

I'm just getting to work with iBatis.Net in my C# project. I found a problem
when I call constructor with groupBy in my ResultMap. What have I done
something wrong?

 

<resultMap id="personResult" class="Person" groupBy="_id">

      <constructor>

          <argument argumentName="id" column="id"/>

      </constructor>

      <result property="_name" column="name" />

      <result property="_address" resultMapping="Person.addressResult"/>

</resultMap>

 

<resultMap id="addressResult" class="Address">

      <result property="_type" column="type" />

      <result property="_value" column="value" />

</resultMap>

 

My error is : System.NullReferenceException: Object reference not set to an
instance of an object.

 

 

Cheers,

Samnang


Re: Constuctor with GroupBy Problem

Posted by Bob Hanson <mn...@gmail.com>.
Group by result maps do not currently support the use of a constructor
element.

On 7/25/07, Samnang Chhun <sa...@gmail.com> wrote:
>
>  Hi,
>
>
>
> I'm just getting to work with iBatis.Net in my C# project. I found a
> problem when I call constructor with groupBy in my ResultMap. What have I
> done something wrong?
>
>
>
> <resultMap id="personResult" class="Person" groupBy="_id">
>
>       <constructor>
>
>           <argument argumentName="id" column="id"/>
>
>       </constructor>
>
>       <result property="_name" column="name" />
>
>       <result property="_address" resultMapping="Person.addressResult"/>
>
> </resultMap>
>
>
>
> <resultMap id="addressResult" class="Address">
>
>       <result property="_type" column="type" />
>
>       <result property="_value" column="value" />
>
> </resultMap>
>
>
>
> My error is : System.NullReferenceException: Object reference not set to
> an instance of an object.
>
>
>
>
>
> Cheers,
>
> Samnang
>