In SDN 6, @Deapth annotation is removed, and also in the latest 6.0.3, support for bi-directional relationship is added. Earlier it was giving StackOverflow while persisting a 2