1 package org.hibernate.engine; 3 4 import java.io.Serializable ; 5 import java.util.HashSet ; 6 import java.util.Map ; 7 8 import org.hibernate.HibernateException; 9 import org.hibernate.LockMode; 10 import org.hibernate.MappingException; 11 import org.hibernate.collection.PersistentCollection; 12 import org.hibernate.persister.collection.CollectionPersister; 13 import org.hibernate.persister.entity.EntityPersister; 14 15 21 public interface PersistenceContext { 22 23 public boolean isStateless(); 24 25 28 public SessionImplementor getSession(); 29 30 33 public CollectionLoadContext getCollectionLoadContext(); 34 35 38 public void addUnownedCollection(CollectionKey key, PersistentCollection collection); 39 40 44 public PersistentCollection useUnownedCollection(CollectionKey key); 45 46 50 public BatchFetchQueue getBatchFetchQueue(); 51 52 55 public void clear(); 56 57 60 public boolean hasNonReadOnlyEntities(); 61 62 65 public void setEntryStatus(EntityEntry entry, Status status); 66 67 70 public void afterTransactionCompletion(); 71 72 76 public Object [] getDatabaseSnapshot(Serializable id, EntityPersister persister) 77 throws HibernateException; 78 79 public Object [] getCachedDatabaseSnapshot(EntityKey key); 80 81 84 public void addEntity(EntityKey key, Object entity); 85 86 90 public Object getEntity(EntityKey key); 91 92 95 public boolean containsEntity(EntityKey key); 96 97 102 public Object removeEntity(EntityKey key); 103 104 107 public Object getEntity(EntityUniqueKey euk); 108 109 112 public void addEntity(EntityUniqueKey euk, Object entity); 113 114 120 public EntityEntry getEntry(Object entity); 121 122 125 public EntityEntry removeEntry(Object entity); 126 127 130 public boolean isEntryFor(Object entity); 131 132 135 public CollectionEntry getCollectionEntry(PersistentCollection coll); 136 137 140 public EntityEntry addEntity(final Object entity, final Status status, 141 final Object [] loadedState, final EntityKey entityKey, final Object version, 142 final LockMode lockMode, final boolean existsInDatabase, 143 final EntityPersister persister, final boolean disableVersionIncrement, boolean lazyPropertiesAreUnfetched); 144 145 149 public EntityEntry addEntry(final Object entity, final Status status, 150 final Object [] loadedState, final Object rowId, final Serializable id, 151 final Object version, final LockMode lockMode, final boolean existsInDatabase, 152 final EntityPersister persister, final boolean disableVersionIncrement, boolean lazyPropertiesAreUnfetched); 153 154 157 public boolean containsProxy(Object proxy); 158 159 166 public boolean reassociateIfUninitializedProxy(Object value) throws MappingException; 167 168 172 public void reassociateProxy(Object value, Serializable id) throws MappingException; 173 174 179 public Object unproxy(Object maybeProxy) throws HibernateException; 180 181 188 public Object unproxyAndReassociate(Object maybeProxy) throws HibernateException; 189 190 197 public void checkUniqueness(EntityKey key, Object object) throws HibernateException; 198 199 212 public Object narrowProxy(Object proxy, EntityPersister persister, EntityKey key, Object object) 213 throws HibernateException; 214 215 220 public Object proxyFor(EntityPersister persister, EntityKey key, Object impl) 221 throws HibernateException; 222 223 228 public Object proxyFor(Object impl) throws HibernateException; 229 230 233 public Object getCollectionOwner(Serializable key, CollectionPersister collectionPersister) 234 throws MappingException; 235 236 239 public void addUninitializedCollection(CollectionPersister persister, 240 PersistentCollection collection, Serializable id); 241 242 245 public void addUninitializedDetachedCollection(CollectionPersister persister, 246 PersistentCollection collection); 247 248 253 public void addNewCollection(CollectionPersister persister, PersistentCollection collection) 254 throws HibernateException; 255 256 260 public void addInitializedDetachedCollection(CollectionPersister collectionPersister, 261 PersistentCollection collection) throws HibernateException; 262 263 266 public CollectionEntry addInitializedCollection(CollectionPersister persister, 267 PersistentCollection collection, Serializable id) throws HibernateException; 268 269 272 public PersistentCollection getCollection(CollectionKey collectionKey); 273 274 278 public void addNonLazyCollection(PersistentCollection collection); 279 280 285 public void initializeNonLazyCollections() throws HibernateException; 286 287 290 public PersistentCollection getCollectionHolder(Object array); 291 292 297 public void addCollectionHolder(PersistentCollection holder); 298 299 303 public PersistentCollection removeCollectionHolder(Object array); 304 305 308 public Serializable getSnapshot(PersistentCollection coll); 309 310 313 public boolean isInverseCollection(PersistentCollection collection); 314 315 320 public CollectionEntry getCollectionEntryOrNull(Object collection); 321 322 325 public Object getProxy(EntityKey key); 326 327 330 public void addProxy(EntityKey key, Object proxy); 331 332 335 public Object removeProxy(EntityKey key); 336 337 340 public HashSet getNullifiableEntityKeys(); 341 342 345 public Map getEntitiesByKey(); 346 347 350 public Map getEntityEntries(); 351 352 355 public Map getCollectionEntries(); 356 357 360 public Map getCollectionsByKey(); 361 362 365 public int getCascadeLevel(); 366 367 370 public int incrementCascadeLevel(); 371 372 375 public int decrementCascadeLevel(); 376 377 380 public boolean isFlushing(); 381 382 385 public void setFlushing(boolean flushing); 386 387 390 public void beforeLoad(); 391 392 395 public void afterLoad(); 396 397 402 public String toString(); 403 404 408 public Serializable getOwnerId(String entity, String property, Object childObject, Map mergeMap); 409 410 414 public Object getIndexInOwner(String entity, String property, Object childObject, Map mergeMap); 415 416 420 public void addNullProperty(EntityKey ownerKey, String propertyName); 421 422 425 public boolean isPropertyNull(EntityKey ownerKey, String propertyName); 426 427 430 public void setReadOnly(Object entity, boolean readOnly); 431 432 } | Popular Tags |