类 LoadContexts


  • public class LoadContexts
    extends Object
    Maps result-sets to specific contextual data related to processing that result set

    Considering the JDBC-redesign work, would further like this contextual info not mapped separately, 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...

    作者:
    Steve Ebersole
    • 构造器详细资料

      • LoadContexts

        public LoadContexts​(PersistenceContext persistenceContext)
        Creates and binds this to the given persistence context.
        参数:
        persistenceContext - The persistence context to which this will be bound.
    • 方法详细资料

      • getPersistenceContext

        public PersistenceContext getPersistenceContext()
        Retrieves the persistence context to which this is bound.
        返回:
        The persistence context to which this is bound.
      • cleanup

        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.

        参数:
        resultSet - The result set for which it is ok to release associated resources.
      • cleanup

        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.

      • hasLoadingCollectionEntries

        public boolean hasLoadingCollectionEntries()
        Do we currently have any internal entries corresponding to loading collections?
        返回:
        True if we currently hold state pertaining to loading collections; false otherwise.
      • hasRegisteredLoadingCollectionEntries

        public boolean hasRegisteredLoadingCollectionEntries()
        Do we currently have any registered internal entries corresponding to loading collections?
        返回:
        True if we currently hold state pertaining to a registered loading collections; false otherwise.
      • getCollectionLoadContext

        public CollectionLoadContext getCollectionLoadContext​(ResultSet resultSet)
        Get the CollectionLoadContext associated with the given ResultSet, creating one if needed.
        参数:
        resultSet - The result set for which to retrieve the context.
        返回:
        The processing context.
      • locateLoadingCollection

        public PersistentCollection locateLoadingCollection​(CollectionPersister persister,
                                                            CollectionKey key)
        Attempt to locate the loading collection given the CollectionKey obtained from the owner's key. The lookup here occurs against all result-set contexts...
        参数:
        persister - The collection persister
        key - The collection key
        返回:
        The loading collection, or null if not found.
      • getEntityLoadContext

        public EntityLoadContext getEntityLoadContext​(ResultSet resultSet)
        Currently unused
        参数:
        resultSet - The result set
        返回:
        The entity load context