public class DefaultSessionFactoryLocator<F> extends java.lang.Object implements SessionFactoryLocator<F>
SessionFactoryLocator using a simple map lookup
and an optional default to fall back on.| Constructor and Description |
|---|
DefaultSessionFactoryLocator(java.util.Map<java.lang.Object,SessionFactory<F>> factories) |
DefaultSessionFactoryLocator(java.util.Map<java.lang.Object,SessionFactory<F>> factories,
SessionFactory<F> defaultFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSessionFactory(java.lang.String key,
SessionFactory<F> factory)
Add a session factory.
|
SessionFactory<F> |
getSessionFactory(java.lang.Object key)
Return a
SessionFactory for the key. |
SessionFactory<F> |
removeSessionFactory(java.lang.Object key)
Remove a session factory.
|
public DefaultSessionFactoryLocator(java.util.Map<java.lang.Object,SessionFactory<F>> factories)
factories - A map of factories, keyed by lookup key.public DefaultSessionFactoryLocator(java.util.Map<java.lang.Object,SessionFactory<F>> factories, SessionFactory<F> defaultFactory)
factories - A map of factories, keyed by lookup key.defaultFactory - A default to be used if the lookup fails.public void addSessionFactory(java.lang.String key,
SessionFactory<F> factory)
key - the lookup key.factory - the factory.public SessionFactory<F> removeSessionFactory(java.lang.Object key)
key - the lookup key.public SessionFactory<F> getSessionFactory(java.lang.Object key)
SessionFactoryLocatorSessionFactory for the key.getSessionFactory in interface SessionFactoryLocator<F>key - the key.