ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ron Grabowski (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATISNET-101) Support for public fields
Date Thu, 08 Sep 2005 19:13:30 GMT
    [ http://issues.apache.org/jira/browse/IBATISNET-101?page=comments#action_12322953 ] 

Ron Grabowski commented on IBATISNET-101:

One of the issues with supporting public fields is how that will affect the existing inline
parameter maps (see InlineParameterMapParser.cs):


Do you have any ideas on how to add support for public fields using that syntax?

What would happen if an object has a public field called Password and a property named Password:


What happens if the public field is the encrypted password and the property is an unencrypted
version? I don't know that you'd want the default behavior to be first check for a property
then check for a public field and use which ever one is found.

One solution may be to introduce an optional memberType parameter for the inline parameter
maps and keep the default syntax for properties:


I agree that the syntax for the resultMaps/parametrMaps should be:

 <parameter property="Password" column="PASSWORD "/>
 <parameter field="Password" column="PASSWORD "/>
 <result property="Password" column="PASSWORD "/>
 <result field="Password" column="PASSWORD "/>

In fact that could probably be extended to be:

 <!-- ??? -->
 <parameter const="DEFAULT_PASSWORD" column="PASSWORD "/>

It seems odd that memberType is used in one scnerio and not the other...

> Support for public fields
> -------------------------
>          Key: IBATISNET-101
>          URL: http://issues.apache.org/jira/browse/IBATISNET-101
>      Project: iBatis for .NET
>         Type: New Feature
>   Components: DataMapper
>  Environment: .Net
>     Reporter: Ling Wang

> Currently, IBatis.Net support only private fields and public properties. For example:
> private string _FirstName; 
> public string FirstName
> {
>         get { return _FirstName; }
>         set { _FirstName = value; }
> }
> IBatis for .Net should also support
> public string FirstName;
> The way of doing it is to add an field attribute starting from:
> <result property="FirstName" column="PER_FIRST_NAME" 
> />
> add support for:
> <result field="FirstName" column="PER_FIRST_NAME" />

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message