zoukankan      html  css  js  c++  java
  • 没有Hibernate配置文件的形式

    直接将hibernate交给spring管理

    <!-- 数据库连接-->

    <bean id="dataSource"
    class="org.apache.commons.dbcp.BasicDataSource">
    <property name="url" value="jdbc:mysql://localhost:3306/test"></property>
    <property name="username" value="root"></property>
    <property name="password" value="root"></property>
    </bean>
    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
    <property name="dataSource">
    <ref bean="dataSource" />
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">
    org.hibernate.dialect.MySQLDialect
    </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.connection.autocommit">false</prop>
    </props>
    </property>

    <!--映射-->
    <property name="mappingResources">
    <list>
    <value>vo/User.hbm.xml</value>
    </list>
    </property>

  • 相关阅读:
    EditText之边框颜色
    Android之drawable state各个属性详解
    Android-第三天
    Android 问题
    ios VS android
    Android-第二天(2)
    collapse
    2020/3/7
    2020/3/6
    P3825 [NOI2017]游戏
  • 原文地址:https://www.cnblogs.com/longlinxie/p/5628310.html
Copyright © 2011-2022 走看看