The examples in this section show how to use the references and referenceNames methods to get information about the associations between the Teacher and Student classes in Figure 4–2. Notice that the referenceNames method does not take the arguments includeQualifiers, includeClassOrigin, and propertyList because these arguments are irrelevant to a method that returns only the names of instances or classes, not their entire contents.
Table 4–10 references and referenceNames Methods
Example |
Output |
Comments |
---|---|---|
references(Student, null, null. false, false, null) |
TeacherStudent |
Returns the associations in which Student participates. |
references(Teacher, null, null. false, false, null) |
TeacherStudent |
Returns the associations in which Teacher participates. |
referenceNames(Teacher, null, null) |
The name of the TeacherStudent class. |
Returns the names of the associations in which Teacher participates. |