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, [EMAIL PROTECTED] 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



Reply via email to