1. I would like to use java record types as my model with mybatis Mappers
2. We are using the Mapper interface and a Configuration class with a ConfigurationCustomizer Bean (no xml)
3. I have multiple TypeMappers that address converting different Lists to Postgres Arrays (i.e., List<String>, List<MyType>)
Issues
1. I don't see how to register mulitiple List<x> type handlers in the TypeHandlerRegistry. It's not possible afaict to declare the Class<> type of a generic list, and therefore one can only effectively register one handler. If' I'm wrong about this, then the rest of my issues might go away, but I've seen no examples.
2. Given that I can't explicitly register a type handler to handle my List<MyType> -> PgArray, I need to specify it in the @Select statement somehow. I can accomplish this in my @Insert statement, but the @Select statement only allows me to do this in an @Results annotation. However, when I do that, I get "There is no setter for property named X" errors as it appears this somehow bypasses my record constructor.
Just as an example:
```
public record MyModel(UUID id, List<MyType> myTypes, List<String> myStrings) {}
CREATE TABLE my_model (id uuid, my_types text[], my_strings text[])
@Mapper
public interface MyModelMapper {
@Insert("""INSERT INTO my_model (my_types, my_strings) VALUES (
#{model.myTypes,typeHandler=MyTypeListTypeHandler},
#{model.myStrings, typeHandler=StringListTypeHandler}
)
@Options(flushCache = Options.FlushCachePolicy.TRUE, useGeneratedKeys = true, keyProperty = "
model.id", keyColumn = "id")
int createMyModel(@Param("model") MyModel model);
@Select(
"""SELECT
mymodel.id, mymodel.my_types, mymodel.my_strings
FROM mymodel
WHERE fixture_id = #{id}::uuid
""")
@Results({
@Result(column="id",property="id"),
@Result(column="my_types", property="myTypes, "typeHandler="StringListTypeHandler.class"),
@Result(column="my_strings", property="myStrings", typeHandler=MyTypeListTypeHandler.class)
})
MyModel getById(@Param("id") UUID id);
}
```
Can I do what I want?
Thank you!