ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Maves <Nathan.Ma...@Sun.COM>
Subject Re: enums & Ibatis
Date Fri, 28 Oct 2005 19:37:20 GMT
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
>
>


Mime
View raw message