Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » engine » loading » [javadoc | source]
org.hibernate.engine.loading
public class: LoadContexts [javadoc | source]
java.lang.Object
   org.hibernate.engine.loading.LoadContexts
Maps result-sets to specific contextual data related to processing that result-sets .

Implementation note: internally an IdentityMap is used to maintain the mappings; IdentityMap was chosen because I'd rather not be dependent upon potentially bad ResultSet#equals and {ResultSet#hashCode} implementations.

Considering the JDBC-redesign work, would further like this contextual info not mapped seperately, but available based on the result set being processed. This would also allow maintaining a single mapping as we could reliably get notification of the result-set closing...

Constructor:
 public LoadContexts(PersistenceContext persistenceContext) 
    Creates and binds this to the given persistence context.
    Parameters:
    persistenceContext - The persistence context to which this will be bound.
Method from org.hibernate.engine.loading.LoadContexts Summary:
cleanup,   cleanup,   cleanupCollectionXRefs,   getCollectionLoadContext,   getEntityLoadContext,   getLoadingCollectionXRefs,   getPersistenceContext,   hasLoadingCollectionEntries,   hasRegisteredLoadingCollectionEntries,   locateLoadingCollection,   locateLoadingCollectionEntry,   registerLoadingCollectionXRef,   unregisterLoadingCollectionXRef
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.engine.loading.LoadContexts Detail:
 public  void cleanup() 
    Release internal state associated with *all* result sets.

    This is intended as a "failsafe" process to make sure we get everything cleaned up and released.

 public  void cleanup(ResultSet resultSet) 
    Release internal state associated with the given result set.

    This should be called when we are done with processing said result set, ideally as the result set is being closed.

  void cleanupCollectionXRefs(Set entryKeys) 
 public CollectionLoadContext getCollectionLoadContext(ResultSet resultSet) 
 public EntityLoadContext getEntityLoadContext(ResultSet resultSet) 
 Map getLoadingCollectionXRefs() 
 public PersistenceContext getPersistenceContext() 
    Retrieves the persistence context to which this is bound.
 public boolean hasLoadingCollectionEntries() 
    Do we currently have any internal entries corresponding to loading collections?
 public boolean hasRegisteredLoadingCollectionEntries() 
    Do we currently have any registered internal entries corresponding to loading collections?
 public PersistentCollection locateLoadingCollection(CollectionPersister persister,
    Serializable ownerKey) 
    Attempt to locate the loading collection given the owner's key. The lookup here occurs against all result-set contexts...
 LoadingCollectionEntry locateLoadingCollectionEntry(CollectionKey key) 
  void registerLoadingCollectionXRef(CollectionKey entryKey,
    LoadingCollectionEntry entry) 
    Register a loading collection xref.

    This xref map is used because sometimes a collection is in process of being loaded from one result set, but needs to be accessed from the context of another "nested" result set processing.

    Implementation note: package protected, as this is meant solely for use by CollectionLoadContext to be able to locate collections being loaded by other CollectionLoadContext s/ResultSet s.

  void unregisterLoadingCollectionXRef(CollectionKey key)