You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Jason Bennett <Ja...@3nonline.com> on 2008/02/22 02:50:01 UTC

Mapping EnumsSets and EnumMaps

I have an unfortunately complicated data structure that I'm trying to
map through iBatis, but alas I'm not making a lot of progress.

I have an object that I'm running validation upon. Each field needs to
be validated for one of several possible problems. The result of this
validation is a collection of fields that have errors, and for each
field a collection of errors for that field. Since I'm using JDK5, I've
chosen to implement these fields and errors as enums, such that I'm
creating a map of fields that have errors, where the key is the field
enum, and the value is an EnumSet of errors.

What I want to configure iBatis to do is to load the complete data
structure when I load my main object. I've read over the documentation
on how to load collections, but iBatis seems to want to make the key
name the column name, when I want the column value to be the key. I'm
also open to changing how I represent the structure, and simply having a
set of objects that contains the field name as a property, with a set of
errors, if this is easier.

Appreciate any and all help.

				jason