I have an POJO class for a JSON as follows:
public class Portcall {
private Long id;
.
.
PreviousPortCall previousPortCall;
NextPortCall nextPortCall;
.
}
Here all the 3 classes-PortCall, PreviousPortCall, NextPortCall are annotated with @Document. Any change in PortCall.java will have effect on its immediate previous and next object as well which are referred by PreviousPortCall and NextPortCall In case I update the PortCall.java in Mongo DB, which order do I save the objects? Shall I save PreviousPortCall and NextPortCall and then go for saving PortCall.java or vice versa and why?