First of all org.springframework.orm.hibernate.LocalSessionFact oryBean is a factory, it implements interface FactoryBean.
When you ask Spring for a bean from your applicationContext (or references this bean in an other), Spring first checks the nature of your bean, if it implements interface FactoryBean, it will be treated as a factory, thus, Spring calls bean method getObject() and returns the object returned by that method.
If you look at org.springframework.orm.hibernate.LocalSessionFact oryBean source you will find:
Code:
public class LocalSessionFactoryBean implements FactoryBean, InitializingBean, DisposableBean {
...
private SessionFactory sessionFactory;
...
/**
* Return the singleton SessionFactory.
*/
public Object getObject() {
return this.sessionFactory;
}
}