1 package org.apache.ojb.odmg; 2 3 17 18 import org.odmg.LockNotGrantedException; 19 import org.apache.ojb.broker.PersistenceBroker; 20 import org.apache.ojb.broker.Identity; 21 import org.apache.ojb.broker.PersistenceBrokerException; 22 23 28 public class NarrowTransaction implements TransactionExt 29 { 30 private TransactionImpl tx; 31 32 public NarrowTransaction(TransactionImpl tx) 33 { 34 this.tx = tx; 35 } 36 37 public TransactionImpl getRealTransaction() 38 { 39 return tx; 40 } 41 42 public void markDelete(Object anObject) 43 { 44 this.tx.markDelete(anObject); 45 } 46 47 public void markDirty(Object anObject) 48 { 49 this.tx.markDirty(anObject); 50 } 51 52 public void flush() 53 { 54 tx.flush(); 55 } 56 57 60 public PersistenceBroker getBroker() 61 { 62 return tx.getBroker(); 63 } 64 65 68 public void join() 69 { 70 throw new UnsupportedOperationException ("Not supported operation"); 71 } 72 73 76 public void leave() 77 { 78 throw new UnsupportedOperationException ("Not supported operation"); 79 } 80 81 84 public void begin() 85 { 86 throw new UnsupportedOperationException ("Not supported operation"); 87 } 88 89 92 public boolean isOpen() 93 { 94 return tx.isOpen(); 95 } 96 97 100 public void commit() 101 { 102 throw new UnsupportedOperationException ("Not supported operation"); 103 } 104 105 108 public void abort() 109 { 110 tx.abort(); 111 } 113 114 117 public void checkpoint() 118 { 119 throw new UnsupportedOperationException ("Not supported operation"); 120 } 121 122 126 public void lock(Object obj, int lockMode) 127 throws LockNotGrantedException 128 { 129 tx.lock(obj, lockMode); 130 } 131 132 136 public boolean tryLock(Object obj, int lockMode) 137 { 138 return tx.tryLock(obj, lockMode); 139 } 140 141 public Object getObjectByIdentity(Identity id) 142 throws PersistenceBrokerException 143 { 144 return tx.getObjectByIdentity(id); 145 } 146 149 public void setImplicitLocking(boolean value) 150 { 151 tx.setImplicitLocking(value); 152 } 153 154 157 public boolean isImplicitLocking() 158 { 159 return tx.isImplicitLocking(); 160 } 161 162 165 public void setCascadingDelete(Class target, String referenceField, boolean doCascade) 166 { 167 tx.setCascadingDelete(target, referenceField, doCascade); 168 } 169 170 173 public void setCascadingDelete(Class target, boolean doCascade) 174 { 175 tx.setCascadingDelete(target, doCascade); 176 } 177 178 public boolean isOrdering() 179 { 180 return tx.isOrdering(); 181 } 182 183 public void setOrdering(boolean ordering) 184 { 185 tx.setOrdering(ordering); 186 } 187 188 198 public boolean isDeleted(Identity id) 199 { 200 return tx.isDeleted(id); 201 } 202 } 203 | Popular Tags |