Return-Path: Delivered-To: apmail-ibatis-dev-archive@www.apache.org Received: (qmail 18297 invoked from network); 20 Feb 2007 15:28:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2007 15:28:27 -0000 Received: (qmail 43162 invoked by uid 500); 20 Feb 2007 15:28:35 -0000 Delivered-To: apmail-ibatis-dev-archive@ibatis.apache.org Received: (qmail 43008 invoked by uid 500); 20 Feb 2007 15:28:35 -0000 Mailing-List: contact dev-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ibatis.apache.org Delivered-To: mailing list dev@ibatis.apache.org Received: (qmail 42996 invoked by uid 99); 20 Feb 2007 15:28:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2007 07:28:35 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2007 07:28:25 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 83D8F7141A2 for ; Tue, 20 Feb 2007 07:28:05 -0800 (PST) Message-ID: <15862384.1171985285522.JavaMail.jira@brutus> Date: Tue, 20 Feb 2007 07:28:05 -0800 (PST) From: "Gilles Bayon (JIRA)" To: dev@ibatis.apache.org Subject: [jira] Commented: (IBATISNET-210) Finding properties on interfaces which "inherites" other interfaces In-Reply-To: <8649935.1171971425699.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IBATISNET-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474470 ] Gilles Bayon commented on IBATISNET-210: ---------------------------------------- As you made some fix, could you share them so that I could incorporate them and check if there's no side effect. Thanks > 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 > > 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.