View Javadoc

1   /*
2    * Copyright 2005 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at 
7    * 
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software 
11   * distributed under the License is distributed on an "AS IS" BASIS, 
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13   * See the License for the specific language governing permissions and 
14   * limitations under the License.
15   */
16  
17  package org.apache.jdo.impl.model.java;
18  
19  import org.apache.jdo.model.java.JavaType;
20  
21  /***
22   * A MutableValueClassType instance represents a mutable class whoses
23   * values may be treated as values rather than refernces during
24   * storing. Note, MutableValueClassType instances are trackable which is
25   * the only difference in behavior to instances of the superclass
26   * ValueClassType. 
27   * <p>
28   * Class PredefinedType provides public static final variables referring
29   * to the JavaType representation for mutable value class types.
30   * 
31   * @see PredefinedType#dateType
32   * @see PredefinedType#sqlDateType
33   * @see PredefinedType#sqlTimeType 
34   * @see PredefinedType#sqlTimestampType
35   * @see PredefinedType#bitsetType
36   *
37   * @author Michael Bouschen
38   * @since JDO 1.0.1
39   */
40  public class MutableValueClassType
41      extends ValueClassType
42  {
43      /*** 
44       * Constructor.
45       * @param clazz the Class instance representing the type
46       * @param superclass JavaType instance representing the superclass.
47       * @param orderable flag indicating whether this type is orderable.
48       */
49      public MutableValueClassType(Class clazz, JavaType superclass, boolean orderable)
50      {
51          super(clazz, superclass, orderable);
52      }
53  
54      /*** 
55       * Returns <code>true</code> if this JavaType represents a trackable
56       * Java class. A JDO implementation may replace a persistent field of
57       * a trackable type with an assignment compatible instance of its own
58       * implementation of this type which notifies the owning FCO of any
59       * change of this field.
60       * @return <code>true</code> if this JavaType represents a trackable
61       * Java class, <code>false</code> otherwise.
62       */
63      public boolean isTrackable() 
64      {
65          return true;
66      }
67  }