1 package org.apache.ojb.odmg.states; 2 3 17 18 import org.apache.ojb.broker.PersistenceBrokerException; 19 import org.apache.ojb.odmg.ObjectEnvelope; 20 21 24 public class StateOldDelete extends ModificationState 25 { 26 private static StateOldDelete _instance = new StateOldDelete(); 27 28 31 private StateOldDelete() 32 { 33 } 34 35 38 public static StateOldDelete getInstance() 39 { 40 return _instance; 41 } 42 43 46 public ModificationState markClean() 47 { 48 return StateOldClean.getInstance(); 49 } 50 51 54 public ModificationState markDelete() 55 { 56 return this; 57 } 58 59 62 public ModificationState markDirty() 63 { 64 return this; 65 } 66 67 70 public ModificationState markNew() 71 { 72 return StateOldDirty.getInstance(); 73 } 74 75 78 public ModificationState markOld() 79 { 80 return this; 81 } 82 83 87 public boolean needsDelete() 88 { 89 return true; 90 } 91 92 95 public void checkpoint(ObjectEnvelope mod) 96 throws org.apache.ojb.broker.PersistenceBrokerException 97 { 98 mod.doDelete(); 99 mod.setModificationState(StateTransient.getInstance()); 100 } 101 102 105 public void commit(ObjectEnvelope mod) throws PersistenceBrokerException 106 { 107 mod.doDelete(); 108 mod.setModificationState(StateTransient.getInstance()); 109 } 110 111 114 public void rollback(ObjectEnvelope mod) 115 { 116 mod.doEvictFromCache(); 117 } 118 } 119 | Popular Tags |