ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samnang Chhun <samnang.ch...@gmail.com>
Subject Internal constructor problem
Date Fri, 20 Jul 2007 02:38:20 GMT
Hi all,

I'm just getting to work with iBatis.Net in my C# project, but I have a
problem with internal constructor. My class has an internal constructor that
doesn't want client side to access this constructor and has another
constructor for client side. In my ResultMap, why can't I call internal
constructor in my ResultMap, but I can map internal property in my
ResultMap. What have I done something wrong with constructor? Does
iBatis.net support this feature?

 

I have a class:

public class Person

{

      internal int _id;

      internal string _name;

      private bool _isNew;

      public Person()

      {

            _isNew = true;

}

internal Person(int id)

      {

            _id = id;

}

.

}

 

<resultMaps>

    <resultMap id="PersonResult" class="Person">

        <constructor>

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

        </constructor>

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

    </resultMap>

  </resultMaps>

  <statements>

    <select id="SelectAllPerson" resultMap="PersonResult">

      SELECT PersonId, name FROM Person

    </select>

  </statements>

 

I hope to hear from you soon.

 

Regards,

Samnang


Mime
View raw message