Dealing with circular reference in Java

In an uni project we had a complex data structure with 2 circular references. We built an android app with a maven spring java backend using docker. The problem was that we could not load all the informations in an entity with cicular references. In this cases we always only got null if we tried to get the correct values from our backend.

Comments

Interesting problem that shows the importance of a well thought through database model (although I'd have liked to read a bit more of a context for that). Many problems can be prevented if the data in the backend is clean and structured. In other cases circular references may exist per design of a framework and may have to be transformed into a view object (DTO) before transporting it to the frontend to prevent such problems.
Artur Marcin Sz... - Sun, 12/09/2018 - 21:01 :::
1 answer

The solution to the problem is that we changed the database model so that we got rid of the circular references. Then we had no problems loading all the data