Class TopiaHibernateSessionRegistry
java.lang.Object
org.nuiton.topia.persistence.internal.TopiaHibernateSessionRegistry
Class used to keep an association between an Hibernate Session and a TopiaPersistenceContext
- Since:
- 3.0
- Author:
- Arnaud Thimel (Code Lutin)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WeakHashMap<org.hibernate.Session,WeakReference<TopiaPersistenceContext>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPersistenceContext(org.hibernate.Session session) Look for the TopiaPersistenceContext based on the given Hibernate sessionvoidregister(org.hibernate.Session session, TopiaPersistenceContext persistenceContext) Register the Session ↔ TopiaPersistenceContext couplevoidunregister(org.hibernate.Session session) Removes the Session ↔ TopiaPersistenceContext association from the registry
-
Field Details
-
registry
-
-
Constructor Details
-
TopiaHibernateSessionRegistry
public TopiaHibernateSessionRegistry()
-
-
Method Details
-
register
Register the Session ↔ TopiaPersistenceContext couple- Parameters:
session- the currently used SessionpersistenceContext- the current TopiaPersistenceContext using this Session
-
getPersistenceContext
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
-