实体(一对多)无法序列化

mybatis 查询出来实体无法序列化

// 在实体上加入如下注解
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })

示例如下:

@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
@ToString
public class RoleVO implements Serializable {

    @NonNull
    private String roleId;
    private String roleName;
    private Short sortNumber;
    private String description;
    private Date gmtCreate;
    private Date gmtModified;

    private String platId;
    private String platName;

    private List privileges;
}

你可能感兴趣的:(实体(一对多)无法序列化)