Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 82347 invoked from network); 22 Nov 2006 13:36:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Nov 2006 13:36:12 -0000 Received: (qmail 52038 invoked by uid 500); 22 Nov 2006 13:36:19 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 52022 invoked by uid 500); 22 Nov 2006 13:36:19 -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 52010 invoked by uid 99); 22 Nov 2006 13:36:19 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 05:36:19 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of anthony.bin.hong@gmail.com designates 66.249.92.174 as permitted sender) Received: from [66.249.92.174] (HELO ug-out-1314.google.com) (66.249.92.174) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 05:36:07 -0800 Received: by ug-out-1314.google.com with SMTP id m2so137676ugc for ; Wed, 22 Nov 2006 05:35:45 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jzdTRWx23sRB0PaDxx6Ead4ojDBPiECWy8OrokjygfXqrC93swEJhqxJWFShn144yENdVenD9O6JbwpdrQmw6iP0aguGTVOzRzHjCS2m2jxkTfSfxvn0vlUriWy8wnZOu4geIrWBNfihrkt0lyRKlFg8rS1jdcV39ZB/pOvYKXc= Received: by 10.78.178.5 with SMTP id a5mr7775605huf.1164202545017; Wed, 22 Nov 2006 05:35:45 -0800 (PST) Received: by 10.78.123.1 with HTTP; Wed, 22 Nov 2006 05:35:44 -0800 (PST) Message-ID: <86de4f4d0611220535s66a114eej46759bf669836105@mail.gmail.com> Date: Wed, 22 Nov 2006 21:35:44 +0800 From: "Anthony Hong" To: user-java@ibatis.apache.org Subject: Re: How to convert data type in java code with ibatis framework In-Reply-To: <2f0ae1370611220254v729e78eeq33f5f7ac9588e04f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <86de4f4d0611211623g435ae588ta27849fb0a1ff0c5@mail.gmail.com> <2f0ae1370611220254v729e78eeq33f5f7ac9588e04f@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Looks like your suggestion can help me. If this problem can be solved, then I think it works. The problem is: ResultGetter in TypeHandlerCallback only works with one filed, how to conjuction with another field. Say my dynamic object has one property save value and one property save its class type. How to do convertion in typehandler that I can access another property in class? I save examples are all about enumation class. If I define its to handle with java.lang.Object, all other specific data type handler with not be used anymore? On 11/22/06, Caio Zanchetti wrote: > Hi, I don't know if I could understand very well your question, but you can > define an "extension" through the TypeHandlerCallback class implementation. > Than you will can automatic convert between two types. > > Regards, > > > > > On 11/21/06, Anthony Hong wrote: > > I have a common table that stores data with id and value. > > The value field defined in DB is varchar2. > > Currently each time I store or retrieve data from db, I convert value > > from object to string in inserting, updating. Or convert value from > > string to objec in selectinig. > > I'd like to know how to achieve with ibatis help, something like > > before paremeter set I can do something. Or in result map. I can do > > convertion. > > > > -- > > > > Anthony Hong > > > > > > -- > Claudiomir G. Zanchetti (Caio) > Sun Certified Programmer for the Java 2 Plataform, Standard Edition 5.0 -- Anthony Hong