'Configuration().configure().buildSessionFactory()' returns a SessionFactory's object which is an interface not implemented by Configuration class? [closed]

StackOverflow https://stackoverflow.com/questions/14583490

سؤال

How does the line Configuration().configure().buildSessionFactory() returns a SessionFactory's object which is an interface not implemented by Configuration class?

هل كانت مفيدة؟

المحلول

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
        );
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top