When you define an implementation class, association implementation details are always generated in the origin and/or destination classes of the navigable association.
Generation uses specific documentation comment tags to store association information. These documentation comment tags gather all the required details to be able to recreate the association upon reverse engineering. The documentation comment tags are processed during reverse engineering in order to make round-trip engineering possible.
The following documentation tags are used:
pdRoleInfo is used to retrieve the classifier name, container type, implementation class, multiplicity and type of the association
pdGenerated is used to flag automatically generated functions linked to association implementation. These functions should not be reverse engineered otherwise generated and reverse engineered models will be different
Make sure you do not modify these tags in order to preserve round-trip engineering.
The javadoc tag syntax is used /**@tag value*/.
In the following example, the tag @pdRoleInfo is used to store association implementation details, and @pdGenerated is used to indicate that the getter method is automatically generated and should not be reverse engineered.
/**@pdRoleInfo name=Person coll=java.util.Collection impl=java.util.LinkedList mult=1..* */ public java.util.Collection employee; /** @pdGenerated default getter */ public java.util.Collection getEmployee() { if (employee == null) employee = new java.util.HashSet(); return employee; } ...
The documentation tag ///<tag value /> is used.
In the following example, the tag <pdRoleInfo> is used to store association implementation details, and <pdGenerated> is used to indicate that the getter method is automatically generated and should not be reverse engineered.
///<pdRoleInfo name='Person' coll='System.CollectionsArrayList' impl='java.util.LinkedList' mult='1..*' type='composition'/> public java.util.Collection employee; ///<pdGenerated> default getter </pdGenerated> ...
The documentation tag "<tag value /> is used.
In the following example, the tag <pdRoleInfo> is used to store association implementation details, and <pdGenerated> is used to indicate that the getter method is automatically generated and should not be reverse engineered.
"<pdRoleInfo name='Person' coll='System.CollectionsArrayList' impl='java.util.LinkedList' mult='1..*' type='composition'/> public java.util.Collection employee; "<pdGenerated> default getter </pdGenerated> ...