Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 26602 invoked from network); 28 Oct 2005 19:36:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Oct 2005 19:36:11 -0000 Received: (qmail 61460 invoked by uid 500); 28 Oct 2005 19:36:01 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 61422 invoked by uid 500); 28 Oct 2005 19:36:01 -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 61366 invoked by uid 99); 28 Oct 2005 19:36:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Oct 2005 12:36:00 -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.34] (HELO brmea-mail-3.sun.com) (192.18.98.34) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Oct 2005 12:35:56 -0700 Received: from fe-amer-09.sun.com ([192.18.108.183]) by brmea-mail-3.sun.com (8.12.10/8.12.9) with ESMTP id j9SJZc3F006544 for ; Fri, 28 Oct 2005 13:35:38 -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 <0IP3001014ZLIZ00@mail-amer.sun.com> (original mail from Nathan.Maves@Sun.COM) for user-java@ibatis.apache.org; Fri, 28 Oct 2005 13:35:38 -0600 (MDT) Received: from [129.147.48.111] by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0IP300I6G53EP1V0@mail-amer.sun.com> for user-java@ibatis.apache.org; Fri, 28 Oct 2005 13:35:38 -0600 (MDT) Date: Fri, 28 Oct 2005 13:37:20 -0600 From: Nathan Maves Subject: Re: enums & Ibatis In-reply-to: <20059.216.239.124.38.1130527530.squirrel@webmail.sonic.net> Sender: Nathan.Maves@Sun.COM To: user-java@ibatis.apache.org Message-id: MIME-version: 1.0 X-Mailer: Apple Mail (2.734) Content-type: text/plain; format=flowed; delsp=yes; charset=US-ASCII Content-transfer-encoding: 7BIT X-Priority: 3 (Normal) References: <20059.216.239.124.38.1130527530.squirrel@webmail.sonic.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I think this is just what you are looking for. http://opensource2.atlassian.com/confluence/oss/display/IBATIS/How+do +I+use+a+Custom+Type+Handler+with+complex+property+or+Type+Safe +Enumeration Nathan On Oct 28, 2005, at 1:25 PM, reubenf@sonic.net wrote: > Are there any good strategies for using enums w/ Ibatis? Are there > plans > to directly support them, if not? > > I have been forcing my enums (which represent valid values of certain > columns, e.g. status columns) to have a value(), e.g.: > > public enum Status { > ... > COMPLETE { public Integer value() { return 400; }}, > COMPLETE_WITH_WARNINGS { public Integer value() { return > 401; }}; > public abstract Integer value(); > } > > ...and then translating that before it gets to Ibatis, using value > (). But > this is a little non-optimal. > > Thanks > Reuben > >