<bean id= "sessionfactory" class= " Org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean ">
<property name= "DataSource" ref= "DataSource" ></property>
<!--<property name= "configlocation" value= "Hibernate.cfg.xml" ></property>-->(3)
<property name= "Hibernateproperties" >
<props>
<prop key= "Hibernate.dialect" >org.hibernate.dialect.Oracle10gDialect</prop>
<prop key= "Hibernate.show_sql" >true</prop>
<prop key= "Hibernate.format_sql" >true</prop>
<prop key= "Hibernate.hbm2ddl.auto" >update</prop>
<prop key= "Hibernate.cache.use_second_level_cache" >true</prop>
<prop key= "Hibernate.cache.provider_class" >org.hibernate.cache.EhCacheProvider</prop>
</props>
</property>
<property name= "Packagestoscan" value= "xxx.xxx"/>
</bean>
above is the configuration of Hibernate's sessionfactory, the bottom of which</property>
<property name= "Packagestoscan" value= "xxx.xxx"/>
is to tell Hibernate to xxx.xxx this package down. Search for comments Generate database tables
If you use (3) configuration requires a hibernate.cfg.xml
Hibernate +spring sessionfactory Configuration