Hibernate SessionFactory

private HibernateTemplate hibernateTemplate;

        public void setSessionFactory(SessionFactory sessionFactory) {
            this.hibernateTemplate = new HibernateTemplate(sessionFactory);
    }

Qu'est-ce que SessionFactory classe?
Pourquoi utilisons-nous?
Qu'est-ce que hibernateTemplate de Classe est-il utilisé?

<bean id="myUserDAO" class="com.mysticcoders.mysticpaste.services.ContactSerImpl">
<property name="sessionFactory" ref="mySessionFactory"/>
</bean>
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="annotatedClasses">
<list>
<value>com.mysticcoders.mysticpaste.model.Contact</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
</props>
</property>
</bean>

Ce ne ce ne haricot

OriginalL'auteur theJava | 2010-12-30