You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Ron Grabowski (JIRA)" <ib...@incubator.apache.org> on 2005/09/08 21:13:30 UTC

[jira] Commented: (IBATISNET-101) Support for public fields

    [ 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):

 #propertyName,type=string,dbype=Varchar,direction=Input,nullValue=N/A,handler=string#

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:

 #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:

 #Password,memberType=field#
 #Password,memberType=property#

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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira