Return-Path: Delivered-To: apmail-ibatis-dev-archive@www.apache.org Received: (qmail 75951 invoked from network); 20 Feb 2006 21:51:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Feb 2006 21:51:48 -0000 Received: (qmail 39500 invoked by uid 500); 20 Feb 2006 21:51:47 -0000 Delivered-To: apmail-ibatis-dev-archive@ibatis.apache.org Received: (qmail 39483 invoked by uid 500); 20 Feb 2006 21:51:47 -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 39471 invoked by uid 99); 20 Feb 2006 21:51:47 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Feb 2006 13:51:46 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id E1449DE for ; Mon, 20 Feb 2006 22:51:25 +0100 (CET) Message-ID: <1705123440.1140472285920.JavaMail.jira@ajax.apache.org> Date: Mon, 20 Feb 2006 22:51:25 +0100 (CET) From: "Sven Boden (JIRA)" To: dev@ibatis.apache.org Subject: [jira] Closed: (IBATIS-243) handling custom tables with custom objects returned from stored procedure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/IBATIS-243?page=all ] Sven Boden closed IBATIS-243: ----------------------------- Resolution: Invalid Assign To: Sven Boden This is a support question. The first response would be: how do you this in JDBC? The second response would be that iBATIS doesn't support it, and will probably not support it. For a third response: have a look at http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:10271519764319 in which they don't advise to use object types in Java. For a fourth and final response: O'Reilly has a book called "Java Programming with Oracle JDBC" in which in Chapter 4 they completely explain what you want to do (in JDBC) and where you will also see it's complexer than the corresponding relational approach. Sven > handling custom tables with custom objects returned from stored procedure > ------------------------------------------------------------------------- > > Key: IBATIS-243 > URL: http://issues.apache.org/jira/browse/IBATIS-243 > Project: iBatis for Java > Type: Improvement > Components: SQL Maps > Versions: 2.1.6 > Environment: Windows XP , > Oracle 10g > java 1.4 > Reporter: Smaranda Tudor > Assignee: Sven Boden > Priority: Critical > > Hi, > I have a problem with iBatis. Because some processings, which need to be done in the database, I have to handle a strange returned datatype. Here is the object structure (as sample, just a smaller than the original): > CREATE OR REPLACE > TYPE FACS_OBJ AS OBJECT > ( > ID NUMBER(12), > NAME VARCHAR2(80), > CODE VARCHAR2(12), > ) > and > CREATE OR REPLACE > type FACS_TABLE as table of FACS_OBJ; > As you can see there is about TABLE OF custom objects. The procedure has only an out parameter of this kind of type. My mapping looks like the next sequence: > > typeName="FACS_TABLE" > mode="OUT" > typeHandler="ArrayTypeHandlerCallback" /> > > > > { call PAC_CR_SECURITY.testSpecialType(?) } > ]]> > > My handler does nothing special than override the getResult function: > public Object getResult(ResultGetter rg) throws SQLException { > if (rg.wasNull()) { > return null; > } > > Array arr = rg.getArray(); > if (arr == null) { > return default_result; > } > ResultSet rs = arr.getResultSet(); > if (rs == null) { > return default_result; > } > > List results = new ArrayList(); > while (rs.next()) { > Object result = rs.getObject(2); > if (log.isDebugEnabled()) { > log.debug("result classname: " + result.getClass().getName()); > } > results.add((Struct)result); > } > return results; > } > My problem is next : the type of inner objects is not transparent to the java application. The struct type is quite difficult to process. How could I handle the returned type in this situation. This object is a simple one because it could contain another lists as members. > Thanks -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira