📜  无法映射“Transaction.id”.也许“字符串”中的片段被认为是一种简单的类型. Mapper 继续使用 Id - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:14.888000             🧑  作者: Mango

代码示例2
By default the id in mongo collection is string. To maintain a long id of obejcts in collection, you can choose a separate field as follows:
@Id
  @Field("_id")
  @JsonIgnore
  private String id;

  @Field("my_object_id")
  private Long myObjectId;