how to store PostgreSQL jsonb using SpringBoot + JPA?

后端 未结 4 1691
不知归路
不知归路 2021-02-01 10:23

I\'m working on a migration software that will consume unknown data from REST services.

I already think about use MongoDB but I decide to not use it and use PostgreSQL.<

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-01 10:54

    If you're using R2DBC you can use dependency io.r2dbc:r2dbc-postgresql, and use type io.r2dbc.postgresql.codec.Json in your member attributes of an entity class, e.g.:

    public class Rule {
        @Id
        private String client_id;
        private String username;
        private String password;
        private Json publish_acl;
        private Json subscribe_acl;
    }
    

提交回复
热议问题