Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 17684 invoked from network); 10 Aug 2006 15:05:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Aug 2006 15:05:30 -0000 Received: (qmail 90703 invoked by uid 500); 10 Aug 2006 15:05:29 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 90595 invoked by uid 500); 10 Aug 2006 15:05:28 -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 90584 invoked by uid 99); 10 Aug 2006 15:05:28 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Aug 2006 08:05:28 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.31] (HELO brmea-mail-1.sun.com) (192.18.98.31) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Aug 2006 08:05:15 -0700 Received: from fe-amer-04.sun.com ([192.18.108.178]) by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k7AF4nXe026973 for ; Thu, 10 Aug 2006 09:04:49 -0600 (MDT) Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0J3S00301F50Y900@mail-amer.sun.com> (original mail from Nathan.Maves@Sun.COM) for user-java@ibatis.apache.org; Thu, 10 Aug 2006 09:04:49 -0600 (MDT) Received: from [129.147.48.168] by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0J3S00DXMF81E0Y4@mail-amer.sun.com> for user-java@ibatis.apache.org; Thu, 10 Aug 2006 09:04:49 -0600 (MDT) Date: Thu, 10 Aug 2006 09:06:41 -0600 From: Nathan Maves Subject: Re: Duplicate typeHandler (same javaType, different jdbcType) In-reply-to: <5735284.post@talk.nabble.com> Sender: Nathan.Maves@Sun.COM To: user-java@ibatis.apache.org Message-id: <60C73869-AC83-4B91-9037-F03915495579@sun.com> MIME-version: 1.0 X-Mailer: Apple Mail (2.752.2) Content-type: text/plain; format=flowed; delsp=yes; charset=US-ASCII Content-transfer-encoding: 7BIT References: <5735284.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Just a thought but why are you writing your own Date/Timestamp handlers? Both of these are covered by TypeHandlers that are bundled with ibatis. You can find their code here http://svn.apache.org/repos/asf/ibatis/ trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/type/ If you are trying to do something other then insert/update date fields please clarify you problem or question. Nathan On Aug 9, 2006, at 4:47 PM, jaybytez wrote: > > TypeHandler gives me accessibility to the SQL Type so I know if the > user is > using the typeHandler for two different SQL data types and perform the > necessary get/set based on that type. For instance, Date and > Timestamp > correlate to the same object DateTime (in my application). So if > the type > that is required is a sql Date...I can do the proper get/set for > SQL Date, > and likewise for Timestamp. With TypeHandlerCallback...I will not > have that > accessibility. So if I create a DateTime/Timestamp handler > callback and > DateTime/Date handler callback...can I register both in the > sqlMapConfig? > Or would iBatis not know what conversion to do when it hits a DateTime > object? > > Current Code: > javaType="com.healthnet.hnfs.common.util.DateTime" > > callback="com.foo.dao.datahandler.DateTimeTypeHandler"/> > > Future Code: > > callback="com.foo.dao.datahandler.DateTimeTypeHandler"/> > callback="com.foo.dao.datahandler.DateTimeTypeHandler"/> > > Is this correct? Without stating the javaType for duplication? > > Thanks, > > jay > -- > View this message in context: http://www.nabble.com/Duplicate- > typeHandler-%28same-javaType%2C-different-jdbcType%29- > tf2081707.html#a5735284 > Sent from the iBATIS - User - Java forum at Nabble.com. >