Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 87375 invoked from network); 12 May 2008 17:24:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 May 2008 17:24:47 -0000 Received: (qmail 67002 invoked by uid 500); 12 May 2008 17:24:45 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 66936 invoked by uid 500); 12 May 2008 17:24:45 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 66925 invoked by uid 99); 12 May 2008 17:24:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 10:24:45 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of clinton.begin@gmail.com designates 64.233.166.183 as permitted sender) Received: from [64.233.166.183] (HELO py-out-1112.google.com) (64.233.166.183) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 17:23:56 +0000 Received: by py-out-1112.google.com with SMTP id a73so153790pye.21 for ; Mon, 12 May 2008 10:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=sYMVvAtWMIYvhQSkE14hxMW9R6VRCQ6lYFsD14hZbcQ=; b=MD8hbBil//oLYh7Swjn+dmw9N73o6F/KOnA5Zu0qXJzNUzfEtk7ZXsc8btAREc5TlWrPP9aKC8WIRqNbiMilIBxSV9DYEy9SsIbLVAXVit/mb6kiW1E79pPcxXyPfZqyh4St2avPtc9bp8dc5z93RTdZ8nWjSnTXlvF2vLPwqqU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=BtGfiYkcbK3MBuSx//CPJhSC9ZiUuHP/LBbU8nG1AA605p0lm+CMIFEB2/7Qf/K+rnuVCKw2mYItPWnUvNEOpFdNzQvq1MZyA6Mg97+tmKNkTeFn9vqSq0HVEvnlk8xZ+uYCXl2kB6aC6s6KcqirGq1sHcz8HJBK/zIFu5ALkxc= Received: by 10.114.39.16 with SMTP id m16mr7938714wam.146.1210613050478; Mon, 12 May 2008 10:24:10 -0700 (PDT) Received: by 10.115.93.20 with HTTP; Mon, 12 May 2008 10:24:10 -0700 (PDT) Message-ID: <16178eb10805121024o79dd43abvc602fe8750a1a474@mail.gmail.com> Date: Mon, 12 May 2008 11:24:10 -0600 From: "Clinton Begin" To: user-java@ibatis.apache.org Subject: Re: Problem exposing protected setters for iBatis In-Reply-To: <9A1FB294C6BAB244BF5EC1A90DD58070041823B0@gsmbcdp25es.firmwide.corp.gs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9A1FB294C6BAB244BF5EC1A90DD58070041823A7@gsmbcdp25es.firmwide.corp.gs.com> <9A1FB294C6BAB244BF5EC1A90DD58070041823AB@gsmbcdp25es.firmwide.corp.gs.com> <536e8800805091504j533a763j1d7763a05aa3a9f0@mail.gmail.com> <9A1FB294C6BAB244BF5EC1A90DD58070041823AD@gsmbcdp25es.firmwide.corp.gs.com> <16178eb10805120754g24fb2225gb385dba97883b486@mail.gmail.com> <2f55db670805120907v2c3f9d89m2279ea5126ecdfe5@mail.gmail.com> <9A1FB294C6BAB244BF5EC1A90DD58070041823AF@gsmbcdp25es.firmwide.corp.gs.com> <2fe5ef5b0805120930k2a08d143lf128ca93f95030c6@mail.gmail.com> <9A1FB294C6BAB244BF5EC1A90DD58070041823B0@gsmbcdp25es.firmwide.corp.gs.com> X-Virus-Checked: Checked by ClamAV on apache.org Waitaminute... maybe I didn't read the earlier threads as well as I should have... Are you saying protected members don't work, but PRIVATE members do!? If so, that is completely screwy! :-) I'll write some tests tonight to see if I can figure out what's going on. Clinton On Mon, May 12, 2008 at 10:39 AM, Kezerashvili, Denis wrote: > > > Private field should do just fine for my purposes, no special handling in > the setter. > Thank you for the quick response to this issue. > > Denis > > > > ________________________________ > From: Brandon Goodin [mailto:brandon.goodin@gmail.com] > Sent: Monday, May 12, 2008 12:31 PM > > > To: user-java@ibatis.apache.org > Subject: Re: Problem exposing protected setters for iBatis > > > > It looks like we have a fix on the way. Is there special logic that is used > in your private setter? If not, I would opt to just ditch the private setter > and set directly to the instance variable once the fix is in to iBATIS. Once > the fix is in iBATIS will set to the private variable if it does not find a > setter. > > Brandon > > > On Mon, May 12, 2008 at 11:25 AM, Kezerashvili, Denis > wrote: > > > > > > > The property is actually private, the setter is protected. > > It is protected so that it's available in the classes extending the parent > class. > > For example, Entity has setId() method defined. User class extends Entity > and therefore has setId() available. > > Honestly, I would prefer the setter to be private in Entity, but that was > causing a problem when iBATIS was persisting classes in the same package for > the classes extending Entity. For child classes of Entity outside of its > package no access modifier other than public worked. > > I guess if the fix can make use of private setters in the parent class it > would be a perfect solution, which actually does not seem unreasonable to > me. > > > > > > ________________________________ > From: Nathan Maves [mailto:nathan.maves@gmail.com] > > Sent: Monday, May 12, 2008 12:08 PM > > > > > > > > To: user-java@ibatis.apache.org > > Subject: Re: Problem exposing protected setters for iBatis > > > > > > > > > > > > Can I ask what the point of labeling the property as protected is in your > case? > > > > > > > > > > On Mon, May 12, 2008 at 8:54 AM, Clinton Begin > wrote: > > > > > I think I've confirmed this bug visually. It looks like a change went > > > in quite some time ago that stopped this from working. I'll write a > > > few unit tests and see if we can get a fix into the next minor beta. > > > We have to re-release anyway, due to a JDK 1.4 incompatibility in the > > > most recent beta. > > > > > > Clinton > > > > > > > > > > > > > > > On Mon, May 12, 2008 at 7:53 AM, Kezerashvili, Denis > > > wrote: > > > > > > > > > > > > Thank you Koka for the link. > > > > > > > > I am actually well aware of the fact that iBATIS uses reflection to > call > > > > setters. And yes it works fine with private setters. It also works > fine with > > > > protected setters for the child classes in the same package. So if you > have > > > > User class extending Entity class that has a protected void setId(); > it will > > > > work for User class in iBATIS. > > > > The problem arises when your User class is NOT in the same package as > your > > > > Entity class. Apparently the reflection calls are made on User class > and for > > > > some reason it has no access to the setId() method inherited from the > Entity > > > > class. If the reflection call was made on Entity instead it would've > worked, > > > > but I do not think iBATIS is doing that. Or maybe it can do that, but > it has > > > > to be configured somehow to make reflection calls on the parent class. > > > > > > > > Does anybody know how to do that, or if it's even possible? > > > > > > > > Any input would be greatly appreciated > > > > > > > > > > > > ________________________________ > > > > From: Nicholoz Koka Kiknadze [mailto:kiknadze@gmail.com] > > > > Sent: Friday, May 09, 2008 6:05 PM > > > > To: user-java@ibatis.apache.org > > > > Subject: Re: Problem exposing protected setters for iBatis > > > > > > > > > > > > Well, here's thread discussing same problem, and it seems private > setId() > > > > should work > > > > > > > > http://www.mail-archive.com/user-java@ibatis.apache.org/msg08629.html > > > > > > > > > > > > >