You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Gilles Bayon (JIRA)" <ib...@incubator.apache.org> on 2007/02/25 14:48:06 UTC

[jira] Closed: (IBATISNET-210) Finding properties on interfaces which "inherites" other interfaces

     [ https://issues.apache.org/jira/browse/IBATISNET-210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles Bayon closed IBATISNET-210.
----------------------------------

       Resolution: Fixed
    Fix Version/s: DataMapper 1.6.1
         Assignee: Gilles Bayon

In SVN

> Finding properties on interfaces which "inherites" other interfaces
> -------------------------------------------------------------------
>
>                 Key: IBATISNET-210
>                 URL: https://issues.apache.org/jira/browse/IBATISNET-210
>             Project: iBatis for .NET
>          Issue Type: Bug
>          Components: DataMapper
>    Affects Versions: DataAccess 1.9, DataMapper 1.6
>         Environment: Visual Studio 2005. .NET 2.0, Windows
>            Reporter: Henrik Uffe Jensen
>         Assigned To: Gilles Bayon
>             Fix For: DataMapper 1.6.1
>
>
> Here is the scenario explained. Don't know if this is really a bug or something that iBatis is just not supposed to support
> First of all lets sketch some simple interfaces and domain classes
> public interface IBaseDomain
> {
>     Guid Id { get; set; }
> }
> public interface IAddress : IBaseDomain
> {
>     string Streetname { get; set; }
> }
> public interface IUser : IBaseDomain
> {
>    IAddress Address { get; set; }
> }
> public class BaseDomain : IBaseDomain
> {
>     public Guid Id
>     {
>              get { ......... }
>              set { ......... }
>     }
> }
> public class Address : IBaseDomain, IAddress
> {
>     public string Streetname
>     {
>             get { ......... }
>             set { ......... }
>     }
> }
> public class User : IBaseDomain, IUser
> {
>     public IAddress Address
>     {
>         get { .......... }
>         set { .......... }
>     }
> }
> Then in a SqlMap we have some statements etc. and a resultmap based on the 'User' class which uses 'Address.Id' and 'Address.Streetname' in the propertynames.... and then problems start because iBatis can only find 'Streetname' property on IAddress and not property 'Id'. The reason is that 'Id' exists in 'IBaseDomain' interface and not directly in the 'IAddress' interface.
> In IBatisNet.Common.Utilities.Objects.ReflectionInfo and IBatisNet.Common.Utilities.Objects.Members.DelegatePropertyGetAccessor (only two places I got problems but maybe more exists) you will get en exception saying that "Property 'Id' on..... can not be found"
> What I did to get going was to do some minor corrections in the mentioned classes where I check if type is an interface and in that case I don't only check for available properties on the type itself, but also use GetInterfaces() on the type to enumerate "inherited" interfaces and check for the property on these types.
> I have found no sideeffects on these little hacks but I'm also only using a minor part of the framework 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.