1 package org.apache.ojb.odmg.states;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 import java.io.Serializable;
19
20 import org.apache.ojb.broker.PersistenceBrokerException;
21 import org.apache.ojb.odmg.ObjectEnvelope;
22
23
24
25
26 public abstract class ModificationState implements Serializable
27 {
28 static final long serialVersionUID = 4182870857709997816L;
29 public ModificationState()
30 {
31 }
32
33
34
35
36 public abstract ModificationState markClean();
37
38
39
40
41 public abstract ModificationState markDelete();
42
43
44
45
46 public abstract ModificationState markDirty();
47
48
49
50
51 public abstract ModificationState markNew();
52
53
54
55
56 public abstract ModificationState markOld();
57
58
59
60
61 public abstract void checkpoint(ObjectEnvelope mod)
62 throws PersistenceBrokerException;
63
64
65
66
67 public abstract void commit(ObjectEnvelope mod)
68 throws PersistenceBrokerException;
69
70
71
72
73 public abstract void rollback(ObjectEnvelope mod);
74
75
76
77
78
79 public String toString()
80 {
81 return this.getClass().getName();
82 }
83
84
85
86
87
88
89 public boolean needsInsert()
90 {
91 return false;
92 }
93
94
95
96
97
98 public boolean needsUpdate()
99 {
100 return false;
101 }
102
103
104
105
106
107 public boolean needsDelete()
108 {
109 return false;
110 }
111
112 public boolean isTransient()
113 {
114 return false;
115 }
116 }