码迷,mamicode.com
首页 > 移动开发 > 详细

一个hitbernate配置文件,带几个表(注意mapping)

时间:2016-04-24 21:53:46      阅读:251      评论:0      收藏:0      [点我收藏+]

标签:

<?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>
        <!-- 数据库连接的URL -->
        <property name="connection.url">jdbc:mysql://localhost:3306/db_database10?characterEncoding=utf8</property>
        <!-- 数据库连接用户名 -->
        <property name="connection.username">root</property>
        <!-- 数据库连接密码 -->
        <property name="connection.password">111</property>
        <!-- Hibernate方言 -->
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <!-- 打印SQL语句 -->
        <property name="show_sql">true</property>
        <!-- 映射文件  -->
        <mapping resource="com/mr/employee/Employee.hbm.xml"/>
        <mapping resource="com/mr/product/Product.hbm.xml"/>
     </session-factory>
 </hibernate-configuration>

 jdbc:mysql://localhost:3306/db_database10?characterEncoding=utf8

一个hitbernate配置文件,带几个表(注意mapping)

标签:

原文地址:http://www.cnblogs.com/qqhfeng/p/5428207.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!