一、spring配置
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="connection.driver_class">com.mysql.jdbc.Driver</prop>
<prop key="hibernate.show_sql">true</prop><!--打印sql语句-->
</props>
</property>
<!-- hbm.xml的映射文件 -->
<property name="mappingDirectoryLocations">
<list>
<value>classpath*:com/core/api/entity</value>
<value>classpath:/com/tdy/sys/role/entity/</value>
<value>classpath:/com/crbt/order/entity/</value>
</list>
</property>
</bean>
二、Hibernate配置
<property name="show_sql">true</property>
<property name="connection.autocommit">false</property> <!-- 在Hibernate中默认为false -->