My application uses MongoDb with Spring-Data.
My User.java is as follows.
User{ //other fields @DBRef List<Request> requests; }
Request.java is as follows.
class Request{ @Id private ObjectId id; @DBRef private User who; @DBRef private User whom; @DBRef private User group; }
I can save both correctly. Say my object user1 contains a list of queries and a query for object1 that contains user1 as the value for whom. When I get the user1 object, I get a StackOverflowError. More details here . Related question
Are there any workarounds for this solution other than using the manual links . Is there any other API that handles circular references correctly.
source share