• hibernate课程 初探一对多映射2-2 Myeclipse进行hibernate基本配置


    本节主要内容:

    1    myeclipse 中hibernate jar包,mysql连接jar包 导入 

    2    hibernate.cfg.xml的配置

    1    一对一映射已经配置过

    2    hibernate.cfg.xml的配置如下:

    <?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="connection.driver_class">com.mysql.jdbc.Driver</property>
         <property name="connection.url">jdbc:mysql://localhost:3306/bendi?useUnicode=true&CharacterEncoding=utf8</property>
         <property name="connection.username">root</property>
         <property name="connection.password"> </property>
         <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
         
         <property name="show_sql">true</property>
         <property name="format_sql">true</property>
         <property name="hbm2ddl.auto">update</property>
      
      <mapping resource = "Student.hbm.xml"/>     
        </session-factory>
    </hibernate-configuration>

  • 相关阅读:
    Live Writer配置
    protobufnet 学习手记
    好的Sql语句也能提高效率(二)
    关于CodeSmith的输出问题
    [Scrum]12.29
    [scrum] 1.4
    分享 关于c#注释的规范
    [Scrum] 1.3
    分享:将XML(VS提取注释时生成)转换为Chm的一个方法
    【Scrum】2010.12.27
  • 原文地址:https://www.cnblogs.com/1446358788-qq/p/8278341.html
Copyright © 2020-2023  润新知