zoukankan      html  css  js  c++  java
  • Hibernate2 和 Hibernate3一些差异

    正文:
    首先packag变了
    Hibernate2:net.sf.hibernate
    Hibernate3:org.hibernate
    Hibernate配置文件更改
    Hibernate2配置文件
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
     <session-factory>
      <property name="hibernate.connection.driver_class">
       com.mysql.jdbc.Driver
      </property>
      <property name="hibernate.connection.url">
       jdbc:mysql://localhost:3306/sunyardwebsite
      </property>
      <property name="hibernate.connection.username">root</property>
      <property name="hibernate.connection.password"></property>
      <property name="hibernate.connection.pool_size">10</property>
      <property name="show_sql">true</property>
      <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
      <property name="hibernate.hbm2ddl.auto">update</property>
      <!-- Mapping files -->
      <mapping resource="test/Cat.hbm.xml" />
     </session-factory>
    </hibernate-configuration>
     
    Hibernate3配置文件
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
     <session-factory>
      <property name="hibernate.connection.driver_class">
       com.mysql.jdbc.Driver
      </property>
      <property name="hibernate.connection.url">
       jdbc:mysql://localhost:3306/sunyardwebsite
      </property>
      <property name="hibernate.connection.username">root</property>
      <property name="hibernate.connection.password"></property>
      <property name="hibernate.connection.pool_size">10</property>
      <property name="show_sql">true</property>
      <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
      <property name="hibernate.hbm2ddl.auto">update</property>
      <!-- Mapping files -->
      <mapping resource="test/Cat.hbm.xml" />
     </session-factory>
    </hibernate-configuration>
     
    类别: Java
    发布日期: 2007-6-29 12:40
  • 相关阅读:
    MySQL启动和关闭命令总结
    MySQL数据库5.6版本首次安装Root密码问题
    tomcat 9性能调优注意事项
    扫除减脂之路上的几个小障碍
    MySQL常见面试题
    关于邮箱发送邮件二之附件及图片
    关于邮箱发送邮件
    关于算法
    python中常见的数据类型
    C++实现复数类的输入输出流以及+-*/的重载
  • 原文地址:https://www.cnblogs.com/yinpengxiang/p/1416129.html
Copyright © 2011-2022 走看看