1 package org.apache.ojb.otm; 2 3 17 18 import java.util.Collection ; 19 import java.util.Iterator ; 20 import org.apache.ojb.broker.Identity; 21 import org.apache.ojb.broker.cache.ObjectCache; 22 import org.apache.ojb.broker.metadata.ClassDescriptor; 23 import org.apache.ojb.broker.query.Query; 24 import org.apache.ojb.otm.lock.LockingException; 25 import org.apache.ojb.otm.core.Transaction; 26 import org.apache.ojb.odmg.oql.EnhancedOQLQuery; 27 import org.odmg.OQLQuery; 28 29 35 public interface OTMConnection 36 { 37 38 48 public void makePersistent(Object object) 49 throws LockingException; 50 51 54 public Transaction getTransaction(); 55 56 59 public void setTransaction(Transaction tx); 60 61 69 public void deletePersistent(Object obj) 70 throws LockingException; 71 72 80 public void lockForWrite(Object object) 81 throws LockingException; 82 83 95 public Object getObjectByIdentity(Identity oid) 96 throws LockingException; 97 98 114 public Object getObjectByIdentity(Identity oid, int lock) 115 throws LockingException; 116 117 122 public Iterator getIteratorByQuery(Query query); 123 124 135 public Iterator getIteratorByQuery(Query query, int lock); 136 137 142 public Iterator getIteratorByOQLQuery(OQLQuery query); 143 144 155 public Iterator getIteratorByOQLQuery(OQLQuery query, int lock); 156 157 168 public Collection getCollectionByQuery(Query query, int lock); 169 170 175 public Collection getCollectionByQuery(Query query); 176 177 182 public Identity getIdentity(Object object); 183 184 public ClassDescriptor getDescriptorFor(Class clazz); 185 186 195 public EditingContext getEditingContext(); 196 197 206 public void invalidate(Identity oid) 207 throws LockingException; 208 209 212 public void invalidateAll() 213 throws LockingException; 214 215 221 public EnhancedOQLQuery newOQLQuery(); 222 223 235 public EnhancedOQLQuery newOQLQuery(int lock); 236 237 242 int getCount(Query query); 243 244 247 void close(); 248 249 252 253 boolean isClosed(); 254 255 259 ObjectCache serviceObjectCache(); 260 261 265 void refresh(Object object); 266 } 267 | Popular Tags |