LocalDateTime序列化异常:Cannot construct instance of `java.time.LocalDateTime`
错误信息:Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of java.time.LocalDateTime (no Creators, like default construct, exist):解决:LocalDateTime属性加上注解/
·
错误信息:
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of java.time.LocalDateTime
(no Creators, like default construct, exist):
解决:LocalDateTime属性加上注解
/**
* 创建时间
*/
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
@JsonSerialize(using = LocalDateTimeSerializer.class)
@TableField(fill = FieldFill.INSERT)
private LocalDateTime gmtCreate;
/**
* 更新时间
*/
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
@JsonSerialize(using = LocalDateTimeSerializer.class)
@TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime gmtModified;
更多推荐
已为社区贡献1条内容
所有评论(0)