01: /**********************************************************************
02: Copyright (c) 2005 Andy Jefferson 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:
16: Contributors:
17: ...
18: **********************************************************************/package org.jpox.jdo.state;
19:
20: import org.jpox.StateManager;
21: import org.jpox.state.LifeCycleState;
22:
23: /**
24: * Class representing the life cycle state of DetachedDirty.
25: *
26: * @version $Revision: 1.3 $
27: **/
28: class DetachedDirty extends LifeCycleState {
29: /** Protected Constructor to prevent external instantiation. */
30: protected DetachedDirty() {
31: isPersistent = false;
32: isDirty = true;
33: isNew = false;
34: isDeleted = false;
35: isTransactional = false;
36:
37: stateType = DETACHED_DIRTY;
38: }
39:
40: /**
41: * Method to return a string version of this object.
42: * @return The string "DETACHED_DIRTY".
43: **/
44: public String toString() {
45: return "DETACHED_DIRTY";
46: }
47:
48: /**
49: * Method to transition to persistent-clean.
50: * @param sm StateManager.
51: * @return new LifeCycle state.
52: **/
53: public LifeCycleState transitionAttach(StateManager sm) {
54: return changeState(sm, P_DIRTY);
55: }
56: }
|