Jackson: @JsonIdentityInfo Object instead of id

后端 未结 3 1998
温柔的废话
温柔的废话 2021-01-12 20:36

Is there a way to influence the serialization process with @JsonIdentityInfo so that it inserts the whole object instead of referencing the id?

@Entity
@Json         


        
3条回答
  •  猫巷女王i
    2021-01-12 21:16

    Like said in the comments and from the links, @JsonIdentityInfo and the Jackson Generators doesn't seem to have an option to enable inserting objects instead of ids.

    After more research we finally found this: deserialize Jackson object in JavaScript containing JsonIdentityInfo

    This was exactly the scenario we had and we are now using JSOG, which is optimized for bidirectional references and it works like a charm on server and client (AngularJS) side.

提交回复
热议问题