mybatis-mapper / mapper

MyBatis Mapper
https://mapper.mybatis.io
Apache License 2.0
325 stars 47 forks source link

字段为泛型时typeHandler报错 #59

Closed louis-web closed 1 year ago

louis-web commented 1 year ago

字段注解如下 :

@Entity.Column(typeHandler = ListStringToStringTypeHandler.class)
private List<String> deptList;

会报以下错误:

class io.mybatis.provider.defaults.GenericTypeResolver$ParameterizedTypeImpl cannot be cast to class java.lang.Class (io.mybatis.provider.defaults.GenericTypeResolver$ParameterizedTypeImpl is in unnamed module of loader 'app'; java.lang.Class is in module java.base of loader 'bootstrap')

另,必须使用 @Entity.Table(value = "tableName", autoResultMap = true)才执行typeHandler, 能否默认就支持。 即仅使用 @Entity.Table(value = "tableName") 或者 @Table(name = "tableName")

abel533 commented 1 year ago

可以加Q群:277256950

另外下午1点有个腾讯会议,如果及时看到并且有时间可以参加:

腾讯会议:649-947-711

dengshidang commented 1 year ago

这个看来还是个问题啊,我的pr10可以提交吗?哈哈,另外mapper 我加了一个AbstractTypeHandler extends BaseTypeHandler 方便使用。