How to map a map JSON column to Java Object with JPA

前端 未结 6 1039
一整个雨季
一整个雨季 2020-12-02 14:22

We have a big table with a lot of columns. After we moved to MySQL Cluster, the table cannot be created because of:

ERROR 1118 (42000): Row size too l

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 15:16

    If you need to map json type property to json format when responding to the client (e.g. rest API response), add @JsonRawValue as the following:

    @Column(name = "params", columnDefinition = "json")
    @JsonRawValue
    private String params;
    

    This might not do the DTO mapping for server-side use, but the client will get the property properly formatted as json.

提交回复
热议问题