public class BeanFactorySessionFactoryLookup extends Object implements SessionFactoryLookup, BeanFactoryAware
SessionFactoryLookup implementation based on a Spring BeanFactory.
Will lookup Spring managed beans identified by bean name, expecting them to be of type SessionFactory.
BeanFactory| Constructor and Description |
|---|
BeanFactorySessionFactoryLookup()
Create a new instance of
BeanFactorySessionFactoryLookup. |
BeanFactorySessionFactoryLookup(BeanFactory beanFactory)
Create a new instance of
BeanFactorySessionFactoryLookup given BeanFactory. |
| Modifier and Type | Method and Description |
|---|---|
SessionFactory |
getSessionFactory(String sessionFactoryName)
Implementations must implement this method to retrieve the
SessionFactory identified by the given name from
their backing store. |
void |
setBeanFactory(BeanFactory beanFactory) |
public BeanFactorySessionFactoryLookup()
BeanFactorySessionFactoryLookup.
The BeanFactory to access must be set via setBeanFactory(BeanFactory).
setBeanFactory(BeanFactory)public BeanFactorySessionFactoryLookup(BeanFactory beanFactory)
BeanFactorySessionFactoryLookup given BeanFactory.
Use of this constructor is redundant if this object is being created by a Spring IoC container, as the supplied
BeanFactory will be replaced by the BeanFactory that creates it (BeanFactoryAware
contract). So only use this constructor if you are using this class outside the context of a Spring IoC container.
beanFactory - the bean factory to be used to lookup session factories, must not be
null.public void setBeanFactory(BeanFactory beanFactory)
setBeanFactory in interface BeanFactoryAwarepublic SessionFactory getSessionFactory(String sessionFactoryName) throws SessionFactoryLookupFailureException
SessionFactoryLookupSessionFactory identified by the given name from
their backing store.getSessionFactory in interface SessionFactoryLookupsessionFactoryName - the name of the SessionFactory.SessionFactory (never null).SessionFactoryLookupFailureException - if the lookup failed.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.