Class SessionFactoryRegistry

java.lang.Object
org.hibernate.internal.SessionFactoryRegistry

public class SessionFactoryRegistry extends Object
A registry of all SessionFactory instances for the same classloader as this class.

This registry is used for serialization/deserialization as well as JNDI binding.

  • Field Details

  • Method Details

    • addSessionFactory

      public void addSessionFactory(String uuid, String name, String jndiName, SessionFactoryImplementor instance, JndiService jndiService)
      Adds a SessionFactory to the registry
      Parameters:
      uuid - The uuid under which to register the SessionFactory
      name - The optional name under which to register the SessionFactory
      jndiName - An optional name to use for binding the SessionFactory into JNDI
      instance - The SessionFactory instance
      jndiService - The JNDI service, so we can register a listener if name is a JNDI name
    • removeSessionFactory

      public void removeSessionFactory(String uuid, String name, String jndiName, JndiService jndiService)
      Remove a previously added SessionFactory
      Parameters:
      uuid - The uuid
      name - The optional name
      jndiName - An optional name to use for binding the SessionFactory nto JNDI
      jndiService - The JNDI service
    • getNamedSessionFactory

      public SessionFactoryImplementor getNamedSessionFactory(String name)
      Get a registered SessionFactory by name
      Parameters:
      name - The name
      Returns:
      The SessionFactory
    • getSessionFactory

      public SessionFactoryImplementor getSessionFactory(String uuid)
    • findSessionFactory

      public SessionFactoryImplementor findSessionFactory(String uuid, String name)
    • hasRegistrations

      public boolean hasRegistrations()
      Does this registry currently contain registrations?
    • clearRegistrations

      public void clearRegistrations()