Hi,
I have a database column that is a `varchar[]`. I'm trying to convert that to a Java property that is an `EnumSet<Foo>`. I defined an AttributeConverter to go from `java.sql.Array` to an EnumSet. The converter method is getting called, but I don't see how I can create an `Array` at that point.
Code:
@Convert(converter = FooConverter.class)
private EnumSet<Foo> foos;
In the converter, I don't see how to build the array:
Code:
public class FooConverter extends EnumSetConverter<Foo> { ... }
public class EnumSetConverter<T extends Enum<T>> implements AttributeConverter<EnumSet<T>, Array> {
public Array convertToDatabaseColumn(EnumSet<T> ts) {
for (T e : ts) {
String s = e.toString();
???
}
}
Maybe I shouldn't use java.sql.Array for this?