01: /**********************************************************************
02: Copyright (c) 2002 Mike Martin (TJDO) and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15: Contributors:
16: 2003 Andy Jefferson - coding standards
17: 2007 Andy Jefferson - converted to true "nondurable" identity class
18: ...
19: **********************************************************************/package org.jpox.store;
20:
21: /**
22: * Object identifier for use with nondurable objects to guarantee uniqueness in the JVM (but not in datastore).
23: * They can also be used as identifiers for classes that have no database extent, such as JPOXSQL result objects.
24: * Refer to JDO 2 [5.4.4]. An Object id class must have the following :-
25: * <ul>
26: * <li>Must be public</li>
27: * <li>Must have a public constructor, which may be the default (no-arg) constructor</li>
28: * <li>All fields must be public</li>
29: * <li>All fields must be of Serializable types.</li>
30: * </ul>
31: *
32: * @version $Revision: 1.4 $
33: */
34: public final class SCOID {
35: public final String objClass;
36:
37: /**
38: * Constructs a new SCOID to identify an object of the given class.
39: * @param objClass The class of the instance being identified.
40: */
41: public SCOID(String objClass) {
42: this .objClass = objClass;
43: }
44:
45: /**
46: * Returns the class of the object identified by this SCOID.
47: * @return The class of the object identified by this SCOID.
48: */
49: public String getSCOClass() {
50: return objClass;
51: }
52: }
|