www.pudn.com > TeachingPlatform.zip > bean.xml, change:2016-11-24,size:1879b


<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> 
 
    <!--数据源--> 
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
        <property name="driverClassName" value="com.mysql.jdbc.Driver"></property> 
        <property name="url" value="jdbc:mysql://127.0.0.1/teachingplatform?useUnicode=true&characterEncoding=UTF-8"></property> 
        <property name="username" value="wangyaochong"></property> 
        <property name="password" value="qwerqwer"></property> 
    </bean> 
 
    <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"> 
        <property name="dataSource" ref="dataSource"></property> 
        <property name="hibernateProperties"> 
            <props> 
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> 
                <prop key="hibernate.hbm2ddl.auto">update</prop> 
                <prop key="hibernate.show_sql">true</prop> 
                <prop key="hibernate.format_sql">true</prop> 
            </props> 
        </property> 
        <!--<property name="annotatedClasses">--> 
            <!--<list>--> 
                <!--<value>entity.PersonEntity</value>--> 
                <!--<value>entity.PrivileageEntity</value>--> 
            <!--</list>--> 
        <!--</property>--> 
        <property name="annotatedPackages" value="entity"></property> 
    </bean> 
    <bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager"> 
        <property name="sessionFactory" ref="sessionFactory"></property> 
    </bean> 
 
</beans>