jjzjj

ObjectIdGenerators

全部标签

java - 当来自不同实体类型的 ID 重叠时,是否可以将 @JsonIdentityInfo 与 ObjectIdGenerators.PropertyGenerator 一起使用?

当来自不同实体类型的ID重叠时,是否可以使用ObjectIdGenerators.PropertyGenerator来使用@JsonIdentityInfo?假设我有以下XML并想用Jackson2.x反序列化它:3Peter3dog3我用@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class,property="id")注释了Foo和Bar类。反序列化失败,出现com.fasterxml.jackson.databind.JsonMappingException:AlreadyhadPOJOfori