mybatis存储数组类型数据设置教程
Posted 洛阳泰山
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mybatis存储数组类型数据设置教程相关的知识,希望对你有一定的参考价值。
数据库字段类型设置为 varchar
实体类增加autoResultMap = true 注解
@TableName(value = "gis_feature_clazz",autoResultMap = true)
字段设置String数组,增加 typeHandler = FastjsonTypeHandler.class 注解
/**
* 权限
*/
@TableField(typeHandler = FastjsonTypeHandler.class)
private String[] permissions;
以上完结,查看效果
数据库存储结果
接口返回结果
以上是关于mybatis存储数组类型数据设置教程的主要内容,如果未能解决你的问题,请参考以下文章