View Javadoc

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