1 package org.apache.ojb.odmg.states; 2 3 17 18 import java.io.Serializable ; 19 20 import org.apache.ojb.broker.PersistenceBrokerException; 21 import org.apache.ojb.odmg.ObjectEnvelope; 22 23 26 public abstract class ModificationState implements Serializable 27 { 28 static final long serialVersionUID = 4182870857709997816L; 29 public ModificationState() 30 { 31 } 32 33 36 public abstract ModificationState markClean(); 37 38 41 public abstract ModificationState markDelete(); 42 43 46 public abstract ModificationState markDirty(); 47 48 51 public abstract ModificationState markNew(); 52 53 56 public abstract ModificationState markOld(); 57 58 61 public abstract void checkpoint(ObjectEnvelope mod) 62 throws PersistenceBrokerException; 63 64 67 public abstract void commit(ObjectEnvelope mod) 68 throws PersistenceBrokerException; 69 70 73 public abstract void rollback(ObjectEnvelope mod); 74 75 79 public String toString() 80 { 81 return this.getClass().getName(); 82 } 83 84 85 89 public boolean needsInsert() 90 { 91 return false; 92 } 93 94 98 public boolean needsUpdate() 99 { 100 return false; 101 } 102 103 107 public boolean needsDelete() 108 { 109 return false; 110 } 111 112 public boolean isTransient() 113 { 114 return false; 115 } 116 } 117 | Popular Tags |