Recently, we added the ability to set a supervisory node as a partner node for another supervisory node. This information is stored in the
extraData field in the
SupervisoryNode class. The partner node is a regular supervisory node and it is related to supply partner.
For now, we handle only single direction so regular node knows about a partner node but the partner node does not know that there is the regular node. We would like to add a missing information to the partner node - in other words, we would like to introduce a bidirectional relation between regular nodes and partner nodes.
As I said at the beginning we store the information in the
extraData field and because of that, some actions will be hard to maintain - mainly because we need to do this manually on service layer:
- if a user adds a new supervisory node that has some partner nodes, backend need to go through all existing nodes to add missing details.
- backend needs to do similar work when a supervisory node is removed from the system.
- the most difficult situation to handle is when we update a node because backend needs to update other nodes and also check if a node is not treated as a partner node by several regular nodes.
I am not 100% sure but I think this could be automatically handled by Hibernate if we would store information in the class field instead of in the