@JsonApiRelationId 和@JsonApiRelation 之间有什么区别?
What is difference between @JsonApiRelationId and @JsonApiRelation?
https://www.crnk.io/releases/stable/documentation/#_jsonapirelation
@JsonApiRelationId 需要什么,因为我认为不使用它没有什么区别?
当您只需要对ID进行操作而不是对整个相关资源进行操作时,或者当相关资源的id可以获得比完整资源便宜得多时,您可以使用@JsonApiRelationId
而不是@JsonApiRelation
资源。
两者可能如下所示:
public class Car {
...
@JsonApiRelationId
private Long ownerId;
@JsonApiRelation
private Person owner;
https://www.crnk.io/releases/stable/documentation/#_jsonapirelation
@JsonApiRelationId 需要什么,因为我认为不使用它没有什么区别?
当您只需要对ID进行操作而不是对整个相关资源进行操作时,或者当相关资源的id可以获得比完整资源便宜得多时,您可以使用@JsonApiRelationId
而不是@JsonApiRelation
资源。
两者可能如下所示:
public class Car {
...
@JsonApiRelationId
private Long ownerId;
@JsonApiRelation
private Person owner;