<!--往ioc容器注入SqlSessionFactory,进而自动生成SqlSession-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan" value="com.example.ssh.orm"/>
<!--映射文件扫描-->
<property name="mappingLocations" value="classpath:com/example/ssh/orm/*.hbm.xml"/>
<!--Hibernate基本配置-->
<property name="hibernateProperties">
<props>
<!--根据实体类自动生成数据库表-->
<prop key="hibernate.hbm2ddl.auto">${ssm.hibernate.hbm2ddl.auto}</prop>
<!--方言-->
<prop key="hibernate.dialect">${ssm.hibernate.dialect}</prop>
<!--显示SQl语句-->
<prop key="hibernate.show_sql">${ssm.hibernate.show_sql}</prop>
<!--格式化SQL-->
<prop key="hibernate.format_sql">${ssm.hibernate.format_sql}</prop>
</props>
</property>
</bean>