How does the line Configuration().configure().buildSessionFactory()
returns a SessionFactory
's object which is an interface not implemented by Configuration
class?
Asked
Active
Viewed 844 times
-1
![](../../users/profiles/1479414.webp)
Andremoniy
- 31,241
- 14
- 110
- 218
![](../../users/profiles/1915593.webp)
Kush
- 35
- 5
-
Why do you think that this object should be implemented by `Configuration` class? – Andremoniy Jan 29 '13 at 13:11
-
i just want to know how the method buildSessionFactory() builds/configures which class's 'object' that is returned & stored in SessionFactory's reference. – Kush Jan 29 '13 at 13:15
-
hey genius it would be more useful if u have hav answered atleast smthin else then decrementing!!! – Kush Jan 29 '13 at 13:31
-
the object is of type "SessionFactoryImpl" which implements SessionFactory interface!!!!!!!!!!!...bttr reply in answeres then in questions! – Kush Jan 29 '13 at 13:35
1 Answers
0
The Hibernate project is open source. You're welcome to look for yourself.
public SessionFactory buildSessionFactory() throws HibernateException {
log.debug( "Preparing to build session factory with filters : " + filterDefinitions );
secondPassCompile();
validate();
Environment.verifyProperties( properties );
Properties copy = new Properties();
copy.putAll( properties );
PropertiesHelper.resolvePlaceHolders( copy );
Settings settings = buildSettings( copy );
return new SessionFactoryImpl(
this,
mapping,
settings,
getInitializedEventListeners(),
sessionFactoryObserver
);
}
![](../../users/profiles/202694.webp)
Pace
- 33,215
- 10
- 99
- 130