Cause
This error occurs if JADE encounters a duplicate relationship reference. An example of this error follows. Consider the following sequence.
There are two classes: Department and Employee.
Each Department has a collection, allEmployees, of all of its employees.
Each Employee has a reference, dept, to their department.
An inverse reference is defined between dept and allEmployees, so that one department has many employees and a single employee has only one department. Both properties are defined to have an update mode of manual/automatic.
An instance of Employee, e, is created.
Two instances of Department, d1 and d2, are created.
e.dept is set to d1 to automatically add e to d1.allEmployees.
e is then manually added to d2 with d2.allEmployees.add(e), at which point JADE attempts to automatically update e.dept.
This causes a duplicated relationship reference error, as in attempting to update e.dept to d2, JADE will find that e is already referenced by d1. Because e.dept is a single-value property (that is, it is not a collection), e can be referenced only by one department at a time.
Action
Change your application code to avoid a duplicated relationship reference.
In relation to the above example, you should consider the following coding changes.
If an employee can have multiple departments, the dept property of Employee should be changed to a collection, allDepartments, and the relationship between Department and Employee should be changed to many-to-many.
This then allows a single Employee object to be referenced by multiple Department objects.
If an employee cannot have multiple departments, the code should be changed to avoid creating duplicate references.