1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.jdo.impl.model.jdo.caching;
19
20 import org.apache.jdo.model.jdo.JDORelationship;
21 import org.apache.jdo.impl.model.jdo.JDOReferenceImplDynamic;
22
23 /***
24 * An instance of this class represents the JDO relationship metadata
25 * of a reference relationship field. This caching implementation
26 * caches any calulated value to avoid re-calculating it if it is
27 * requested again.
28 *
29 * @author Michael Bouschen
30 * @since 2.0
31 * @version 2.0
32 */
33 public class JDOReferenceImplCaching extends JDOReferenceImplDynamic {
34
35 /***
36 * Get the mappedBy relationship. If there is no mappedBy relationship
37 * set, the method checks the mappedBy name as specified in the declaring
38 * field and resolves the relationship. The method returns
39 * <code>null</code> if there is no mappedBy relationship set and there
40 * is no mappedBy name specified on the declaring field.
41 * @return the mappedBy relationship if available; <code>null</code>
42 * otherwise.
43 */
44 public JDORelationship getMappedBy() {
45 if (mappedBy == null) {
46 mappedBy = super.getMappedBy();
47 }
48 return mappedBy;
49 }
50
51 /***
52 * Get the inverse JDORelationship in the case of a two-way relationship.
53 * @return the inverse relationship
54 */
55 public JDORelationship getInverseRelationship() {
56 if (inverse == null) {
57 inverse = super.getInverseRelationship();
58 }
59 return inverse;
60 }
61 }