We're using MyBatis with XMLs to map DB tables to Java POJOs. I'm facing an issue because we've a wrapper class for POJO fields. The structure is as follows:
Wrapper class:
class ColumnWrapper<T> {
T value;
T nextValue;
}
Class to be mapped with DB table:
class ParentClass {
ColumnWrapper<String> stringField;
ColumnWrapper<CompositeClass> compositeClass;
... other fields and getter/setters
}
Composite class is a simple POJO:
class CompositeClass {
String compositeField1;
Integer compositeField2;
}
I wrote a TypeHandler for ColumnWrapper<String>
and it is working fine for stringField
. But I'm not able to map ColumnWrapper<CompositeClass> compositeClass
field. I tried creating TypeHandler for it but it's not working. Can anyone please help with it?