Return-Path: Delivered-To: apmail-ibatis-dev-archive@www.apache.org Received: (qmail 99797 invoked from network); 21 Feb 2007 00:51:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Feb 2007 00:51:27 -0000 Received: (qmail 87820 invoked by uid 500); 21 Feb 2007 00:51:35 -0000 Delivered-To: apmail-ibatis-dev-archive@ibatis.apache.org Received: (qmail 87791 invoked by uid 500); 21 Feb 2007 00:51:34 -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 87780 invoked by uid 99); 21 Feb 2007 00:51:34 -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 16:51:34 -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 16:51:25 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A20BC7141A3 for ; Tue, 20 Feb 2007 16:51:05 -0800 (PST) Message-ID: <673614.1172019065661.JavaMail.jira@brutus> Date: Tue, 20 Feb 2007 16:51:05 -0800 (PST) From: "Jan Vissers (JIRA)" To: dev@ibatis.apache.org Subject: [jira] Created: (IBATIS-397) Support for Oracle "OPAQUE" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Support for Oracle "OPAQUE" --------------------------- Key: IBATIS-397 URL: https://issues.apache.org/jira/browse/IBATIS-397 Project: iBatis for Java Issue Type: Improvement Components: SQL Maps Affects Versions: 2.3.0, 2.2.0 Reporter: Jan Vissers Based on the custom type handler described in: http://opensource.atlassian.com/confluence/oss/display/IBATIS/XMLTypeHandlerCallback.java we tried to use this handler not only for "regular select" statements but also for "callable statements". As it turns out the current iBatis codebase doesn't allow us to use and/or extend the type handler to fully support Oracle's RDBMS XMLType datatype. I've experimented a bit and suggest the following solution: 1) Modify the JdbcTypeRegistry class in order for it to contain the ORACLEOPAQUE (much like the ORACLECURSOR already specified) {code:title=com.ibatis.sqlmap.engine.type.JdbcTypeRegistry} setType("ORACLEOPAQUE", 2007); {code} 2) Modify the CallableStatementResultSet class to have it expose its decorated "CallableStatement" instance: {code:title=com.ibatis.sqlmap.engine.type.CallableStatementResultSet} public CallableStatement getCs() { return cs; } {code} With these two modifications we can declare the mapping as follows: {code:xml} {code:xml} We have to change the XMLTypeHandlerCallback (referenced at the top) in order for the getResult() to determine whether to perform work for a CallableStatementResultSet or an OracleResultSet, like so: {code:title=com.yourpackage.XMLTypeHandlerCallback} //The handler getResult public Object getResult(ResultGetter getter) throws SQLException { if (getter.getResultSet() instanceof CallableStatementResultSet) { if (((CallableStatementResultSet) getter.getResultSet()).getCs() instanceof OracleCallableStatement) { OracleCallableStatement ocsmt = (OracleCallableStatement) ((CallableStatementResultSet) getter.getResultSet()).getCs(); // go to work } else { throw new UnsupportedOperationException("XMLType mapping only supported for Oracle RDBMS"); } } else if (getter.getResultSet() instanceof OracleResultSet) { // go to work } else { throw new UnsupportedOperationException("XMLType mapping only supported for Oracle RDBMS"); } } {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.