杰克逊已经有了POJO的身份证

时间:2016-04-08 18:13:23

标签: java json jackson

我在服务中遇到错误:Already had POJO for id

我有一个需要实体列表的方法,我正在将对象传递给它。

我的实体类定义为:

@JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@asset_id", scope=Asset.class)
public class Asset extends BaseEntity implements Serializable {

当我发送对象时,我发送的所有属性都已填写但没有定义@asset_id

当我从数据库中获取项目列表时,它是这样的:

[{ "@actor_id": 1, "id": 1, "name": "Test" }]

当我寄回时,我发送

[{ "id": 1, "name": "Test" }]

为什么我收到此错误?如果我离开@actor_id,我也会收到错误。我无法理解。

0 个答案:

没有答案