SysPluginTypeDef sysPluginTypeDef = new SysPluginTypeDef();
sysPluginTypeDef.setName("xxx");
List<SysPluginTypeDef> map = sysPluginTypeDefService.selectSysPluginTypeDefList(sysPluginTypeDef);
System.out.println(map);
打印的数据是下面这个
[{"id":"515aa791-abf0-11eb-8581-901b0ec7714e","name":"PLC-KEP","deleted":0,"createTime":"Mon May 03 17:17:02 CST 2021"}]
怎样将这个结果转换为Map<string,object>形式的呢,强转会报错。
ps: 在entity设置了
ToStringStyle.JSON_STYLE 所以打印结果是上面那种
public String toString() {
return new ToStringBuilder(this,ToStringStyle.JSON_STYLE)
.append("id", getId())
.append("name", getName())
.append("deleted", getDeleted())
.append("createTime", getCreateTime())
.toString();
}