【发布时间】:2017-05-21 04:33:54
【问题描述】:
我有以下课程:
public class Person
{
@Id
ObjectId Id;
String name;
@DBRef(lazy = true)
List<Entity> entities;
/* Getters and setters omitted for brevity. */
}
public class Entity
{
@Id
ObjectId Id;
String entityName;
@DBRef(lazy = true)
List<Person> people;
/* Getters and setters omitted for brevity. */
}
现在,由于某种原因,当我尝试使用这些链接时,我遇到了一个无限循环......我认为lazy = true 阻止了这种情况,有人知道我做错了什么吗?
【问题讨论】:
标签: java spring mongodb spring-data spring-data-mongodb