ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don Dwoske" <...@loraxis.com>
Subject Re: using public fields instead of properties ?
Date Thu, 21 Sep 2006 15:13:10 GMT
I'm digging into this myself, it appears that there is support for
Fields - althought I can't really find any examples... but I'm getting
this exception when using a public field instead of a property  (.NET
2.0 and DataMapper 1.5.1) :

Unhandled Exception: System.InvalidProgramException: Common Language
Runtime detected an invalid program.
   at SetImplementation(Object , Object )
   at IBatisNet.Common.Utilities.Objects.Members.DelegateFieldSetAccessor.SetValue.Invoke(Object
instance, Object value)

   at IBatisNet.Common.Utilities.Objects.Members.DelegateFieldSetAccessor.Set(Object
target, Object value) in C:\novarti
s\remoteReg\lwa\third-party\DataMapper-Source\IBatisNet.Common\Utilities\Objects\Members\DelegateSetFieldAccessor.cs:lin
e 147
   at IBatisNet.DataMapper.DataExchange.DotNetObjectDataExchange.SetData(Object&
target, ResultProperty mapping, Object
dataBaseValue) in
C:\novartis\remoteReg\lwa\third-party\DataMapper-Source\IBatisNet.DataMapper\DataExchange\DotNetObject
DataExchange.cs:line 95
   at IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.SetValueOfProperty(Object&
target, ResultProperty prope
rty, Object dataBaseValue) in
C:\novartis\remoteReg\lwa\third-party\DataMapper-Source\IBatisNet.DataMapper\Configuration


On 9/21/06, Don Dwoske <don@loraxis.com> wrote:
> I see this in the documentation :
>
> 3.5.4. <result> Elements
> The <resultMap> element holds one or more <result> child elements that
> map SQL resultsets to object properties.
>
> 3.5.4.1. property
> The property attribute is the name of a **field** or a property of the
> result object that will be returned by the Mapped Statement. The name
> can be used more than once depending on the number of times it is
> needed to populate the results.
>
>
> If I try to use a public field, iBatis does not work.  The way .NET
> properties are implemented - it's easy to start by using public
> fields, then switch to using getters and setters later.  This is nice
> because I find getters and setters to be verbose and painful in the
> beginning... I know it's not "best practice" - but....
>
> are the use of public properties expected to be supported by iBatis.NET anytime?
>
>
>
>
> --
>
> ---------------------------------------
> Donald Dwoske
> Software Journeyman
> http://www.loraxis.com/ddwoske
>


-- 

---------------------------------------
Donald Dwoske
Software Journeyman
http://www.loraxis.com/ddwoske

Mime
View raw message