cancel
Showing results for 
Search instead for 
Did you mean: 

Interdependent reference between two models

nikhilaraballi
Champ in-the-making
Champ in-the-making
I've coded two model files. For some associations both models have reference to a type in the other file. Also I updated depends-on tag (one model depends on the other) of beans in context file (I know depends-on tag refers to bean which is already created). It is throwing error when I run in tomcat.
(1) Is there a way to achieve the above without error?
(2) If not, put all types in one model file, is it what I need to do?
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

you can not have two models that depend on one another in a cirular way. But you also do not need to move alls types into one model file. It should be enough to move the associations to one file, so you have one model depend on the other without the circular route. It should be easy to move the association - you just need to update the name and target class.

Regards
Axel

Thank you Axel, your suggestion was helpful, I moved associations to one file and its working for me now