Hibernate hibernate.cfg.xml 基本配置 和 .hbm.xml基本配置
来源:互联网 发布:olfa美工刀片 编辑:程序博客网 时间:2024/06/09 21:34
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.username">root</property><property name="connection.password">1</property><property name="connection.url">jdbc:mysql://localhost/hibernate5</property><property name="connection.driver_class">com.mysql.jdbc.Driver</property><!-- 配置Hibernate基本信息 --><!-- hibernate所使用的数据库方言 --><property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property><!-- 操作时是否在控制台打印sql --><property name="show_sql">true</property><!-- 是否格式化数据库 --><property name="format_sql">true</property><!-- 指定生成数据表的策略 --><property name="hbm2ddl.auto">update</property><!-- 指定关联的.hbm.xml. --><mapping resource="com/bianqiang/hibernate/News.hbm.xml"/></session-factory></hibernate-configuration>
.hbm.xml基本配置
<?xml version="1.0"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"><!-- Generated 2017-4-12 10:38:15 by Hibernate Tools 3.4.0.CR1 --><hibernate-mapping> <class name="com.bianqiang.hibernate.News" table="NEWS"> <id name="id" type="java.lang.Integer"> <column name="ID" /> <!-- 指定主键的生成方式 native:使用数据库本地的方式--> <generator class="native" /> </id> <property name="title" type="java.lang.String"> <column name="TITLE" /> </property> <property name="autor" type="java.lang.String"> <column name="AUTOR" /> </property> <property name="date" type="java.util.Date"> <column name="DATE" /> </property> </class></hibernate-mapping>
0 1
- hibernate 的cfg.xml 和 hbm.xml文档基本配置
- Hibernate hibernate.cfg.xml 基本配置 和 .hbm.xml基本配置
- hibernate.cfg.xml基本配置
- hibernate.cfg.xml的基本配置
- Hibernate5的hibernate.cfg.xml基本配置
- hibernate两个配置模板(***.hbm.xml;***.cfg.xml)
- Hibernate连接SQL Server2008时候hibernate.cfg.xml和table.hbm.xml文件的配置详情
- hibernate.hbm.xml配置
- Hibernate hbm.xml配置
- hibernate.hbm.xml配置
- hibernate.hbm.xml配置
- hibernate.cfg.xml和.hbm.xml
- Event.hbm.xml和hibernate.cfg.xml
- hibernate.cfg.xml配置
- hibernate.cfg.xml配置
- hibernate.cfg.xml配置
- hibernate.cfg.xml配置
- hibernate.cfg.xml配置
- Linux命令find的35个实例
- 软件测试面试题----怎么测电梯
- 基于SYD8801的蓝牙遥控器设计方案
- 关于mybatis-generator中文注释 乱码解决
- Redis存储结构
- Hibernate hibernate.cfg.xml 基本配置 和 .hbm.xml基本配置
- Centos设置系统时间与网络时间同步
- 京东2017实习生招聘试题 某二叉树的前序遍历序列和后序遍历序列正好相反,则该二叉树具有的特征是
- Bullet physics 引擎的官方文档翻译
- 进程和线程的区别与联系
- 一、Git安装及其简单的快捷配置
- 猜拳问题,需要比较的次数
- HashMap详解
- Gitlab部署CI并使用.gitlab-ci.yml配置您的作业(中文翻译)