1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jdo.impl.model.jdo.caching;
18
19 import org.apache.jdo.model.ModelException;
20 import org.apache.jdo.model.java.JavaField;
21 import org.apache.jdo.model.java.JavaProperty;
22 import org.apache.jdo.model.jdo.JDOClass;
23 import org.apache.jdo.model.jdo.JDOField;
24 import org.apache.jdo.impl.model.jdo.JDOAssociatedPropertyImplDynamic;
25
26 /***
27 * An instance of this class represents the JDO metadata of a managed property
28 * of a persistence capable class. This JDOProperty implementation is used for
29 * persistent properties with an associated JDOField. All JDOField getter
30 * methods delegate to the associated JDOField, except methods getName,
31 * getDeclaringClass and getJavaField. All JDOField setter method throw a
32 * ModelException to avoid changing the associated JDOField through this
33 * JDOProperty instance. This caching implementation caches any calculated
34 * value to avoid re-calculating it if it is requested again.
35 *
36 * @author Michael Bouschen
37 * @since 2.0
38 * @version 2.0
39 */
40 public class JDOAssociatedPropertyImplCaching
41 extends JDOAssociatedPropertyImplDynamic
42 {
43 /*** Constructor. */
44 protected JDOAssociatedPropertyImplCaching(
45 String name, JDOClass declaringClass, JDOField associatedJDOField)
46 throws ModelException {
47 super(name, declaringClass, associatedJDOField);
48 }
49
50
51
52 /***
53 * Get the corresponding JavaProperty representation for this JDOProperty.
54 * @return the corresponding JavaProperty representation
55 */
56 public JavaField getJavaField() {
57 if (javaProperty == null) {
58 javaProperty = (JavaProperty)super.getJavaField();
59 }
60 return javaProperty;
61 }
62 }