1 package org.apache.ojb.odmg.states; 2 3 17 18 import org.apache.ojb.odmg.ObjectEnvelope; 19 20 23 public class StateOldDirty extends ModificationState 24 { 25 26 29 public ModificationState markClean() 30 { 31 return this; 32 } 33 34 37 public ModificationState markDelete() 38 { 39 return StateOldDelete.getInstance(); 40 } 41 42 45 public ModificationState markDirty() 46 { 47 return this; 48 } 49 50 53 public ModificationState markNew() 54 { 55 return this; 56 } 57 58 61 public ModificationState markOld() 62 { 63 return this; 64 } 65 66 private static StateOldDirty _instance = new StateOldDirty(); 67 68 71 private StateOldDirty() 72 { 73 } 74 75 78 public static StateOldDirty getInstance() 79 { 80 return _instance; 81 } 82 83 86 public void checkpoint(ObjectEnvelope mod) 87 throws org.apache.ojb.broker.PersistenceBrokerException 88 { 89 mod.doUpdate(); 90 } 91 92 93 96 public void commit(ObjectEnvelope mod) throws org.apache.ojb.broker.PersistenceBrokerException 97 { 98 mod.doUpdate(); 99 mod.setModificationState(StateOldClean.getInstance()); 100 } 101 102 105 public void rollback(ObjectEnvelope mod) 106 { 107 mod.doEvictFromCache(); 108 113 } 116 117 120 public boolean needsUpdate() 121 { 122 return true; 123 } 124 125 } 126 | Popular Tags |