Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 82756 invoked from network); 19 Oct 2005 22:20:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Oct 2005 22:20:47 -0000 Received: (qmail 80841 invoked by uid 500); 19 Oct 2005 22:20:45 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 80714 invoked by uid 500); 19 Oct 2005 22:20:43 -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 80663 invoked by uid 99); 19 Oct 2005 22:20:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2005 15:20:43 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [66.163.179.160] (HELO web35706.mail.mud.yahoo.com) (66.163.179.160) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 19 Oct 2005 15:20:40 -0700 Received: (qmail 78130 invoked by uid 60001); 19 Oct 2005 22:20:19 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=360HxOFRGfPrpxIthSpRR/aK/SfWK0WhN08zAkkMLMZKNDm3rCw189NPMjk5dYyKq3iFXbEh4NSyIhW4AbV7KX0zJTpOa1R7l+p9D+O2nis3CsvmwKfy0tvrjniZ3qX3/HlCncstI72ndJPzudBbOsN3CVNwPag4XS9mYefTeaE= ; Message-ID: <20051019222019.78128.qmail@web35706.mail.mud.yahoo.com> Received: from [70.240.132.221] by web35706.mail.mud.yahoo.com via HTTP; Wed, 19 Oct 2005 15:20:18 PDT Date: Wed, 19 Oct 2005 15:20:18 -0700 (PDT) From: Jeff Roberts Subject: Request to change access modifiers To: user-java@ibatis.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I have recently added and extension to the iBatis framework. In order for my extension to work effectively, I had to subclass several of the iBatis classes. In doing so, I found that some of the methods and variables in the iBatis classes were declared as private, preventing me access to them from my subclasses. I changed the following access modifiers in the following iBatis classes: - com.ibatis.sqlmap.client.SqlMapClient I changed the default constructor from private to protected. This still prevents public instantiation of the class, but allows me to instantiate my subclass. - com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser I changed the static variable "parser" from private to protected. This allows me to access the parser from my subclass. I also changed the addSqlMapNodelets() method from private to protected, allowing me to override it in my subclass and extend its behavior. - com.ibatis.sqlmap.engine.builder.xml.SqlMapParser I changed the static variable "parser" from private to protected. This allows me to access the parser from my subclass. I also changed the addStatementNodelets() method from private to protected, allowing me to override it in my subclass and extend its behavior. - com.ibatis.sqlmap.engine.impl.SqlMapClientImpl I changed the variable "localSqlMapSession" from private to protected, allowing my subclass to access it. I also changed the getLocalSqlMapSession() from private to protected, allowing me to override it in my subclass and extend its behavior. - com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate I changed the variable "sqlExecutor" from private to protected, allowing my subclass to access it. I also changed the autoEndTransaction(), autoCommitTransaction() and autoStartTransaction() methods from private to protected, allowing my subclass to invoke them. I would like to request that the iBatis development team make these same changes to the iBatis source code. In my view, it doesn't change any behavior or introduce any changes to the source code other than to make key pieces of the code accessible to subclasses. By making these changes, I can implement an extension to iBatis by subclassing the classes I've mentioned above and providing an additional feature. To help bolster my case, I would like to describe my extension. I would be happy to submit my extension to the iBatis development team for inclusion into the framework or as a third party extension. If neither is desired, I'm happy to use the extension for my own use. The extension that I have created is to provide an alternate mechanism for returning XML as a result of a query. While I realize iBatis already provides support for XML, this extension is different. My understanding is that iBatis can return an XML document (DOM) from a result set. This is adequate if you wish to use the DOM within the application. My extension returns a java.io.InputStream subclass, which is a stream of XML derived from a result set. The stream is dynamically produced as the InputStream is read. This allows you to simply stream it out to a caller or run it through an XSLT transformation on the server or on the client. It uses SAX callbacks and therefore minimizes the memory requirements and can handle a virtually unlimited size result set since the results are streamed. I've also included support for skipping and max results as is the case when querying for lists in iBatis. The extension does not require anything special in the SELECT statement declaration. You can use any select statement for queryForObject, queryForList or queryForXml (my extension method). It works within the context of the iBatis transaction model. I can attach the source code I've changed in iBatis if that helps. I can also provide additional examples or explanation of the extension if that would help. As I just joined the mailing list, I'm not sure what my next step should be. I assume someone will respond to this request. Thank you, Jeff Roberts P.S. If Jeff Butler reads this, I'm the Jeff Roberts you know from St. Louis. __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com