Class TopiaHibernateSessionRegistry

java.lang.Object
org.nuiton.topia.persistence.internal.TopiaHibernateSessionRegistry

public class TopiaHibernateSessionRegistry extends Object
Class used to keep an association between an Hibernate Session and a TopiaPersistenceContext
Since:
3.0
Author:
Arnaud Thimel (Code Lutin)
  • Field Details

  • Constructor Details

    • TopiaHibernateSessionRegistry

      public TopiaHibernateSessionRegistry()
  • Method Details

    • register

      public void register(org.hibernate.Session session, TopiaPersistenceContext persistenceContext)
      Register the Session ↔ TopiaPersistenceContext couple
      Parameters:
      session - the currently used Session
      persistenceContext - the current TopiaPersistenceContext using this Session
    • getPersistenceContext

      public TopiaPersistenceContext getPersistenceContext(org.hibernate.Session session)
      Look for the TopiaPersistenceContext based on the given Hibernate session
      Parameters:
      session - the Hibernate Session to use
      Returns:
      the TopiaPersistenceContext using this Session, or null if not found
    • unregister

      public void unregister(org.hibernate.Session session)
      Removes the Session ↔ TopiaPersistenceContext association from the registry
      Parameters:
      session - the Hibernate Session to remove