hibernate hbm.xml配置文件说明
来源:互联网 发布:linux安装xwindow 编辑:程序博客网 时间:2024/06/08 12:50
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.oreilly.hh.Track" table="TRACK">
<meta attribute="class-description">
Represents a single playable track in the music database.
@author Jim Elliot(with help from Hibernate)
</meta>
<id name="id" type="int" column="TRACK_ID">
<meta attribute="scope-set">protected</meta>
<generator class="native"/>
</id>
<property name="title" type="string" not-null="true"/>
<property name="filePath" type="string" not-null="true"/>
<property name="playTime" type="time">
<meta attribute="field-description">Playing time</meta>
</property>
<property name="added" type="date">
<meta attribute="field-description">When the track was created</meta>
</property>
<property name="volume" type="short" not-null="true">
<meta attribute="field-description">How loud to play the track</meta>
</property>
</class>
</hibernate-mapping>
说明如下:
1.<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
用于导言说明,说明它的文件格式定义。
2.<hibernate-mapping>标签里是真正的映射。
3.<class name="com.oreilly.hh.Track" table="TRACK">
定义一个类com.oreilly.hh.Track的映射。(可以定义任意多个类在一个映射文件里)。表示存在数据库表TRACK中。
4. <meta attribute="class-description">
Represents a single playable track in the music database.
@author Jim Elliot(with help from Hibernate)
</meta>
定义了说明,可以被JavaDoc读取。
5. <id name="id" type="int" column="TRACK_ID">
<meta attribute="scope-set">protected</meta>
<generator class="native"/>
</id>
定义了类属性和数据库表列的映射。 <generator class="native"/>是表示ID生成策略,此种策略有多种。
6. <property name="volume" type="short" not-null="true">
<meta attribute="field-description">How loud to play the track</meta>
</property> 定义了说明,可以被JavaDoc读取。
- hibernate hbm.xml配置文件说明
- hibernate实体配置文件 *.hbm.xml
- Hibernate***.hbm.xml配置文件详解
- Hibernate主配置文件 hibernate.hbm.xml
- hibernate *.hbm.xml 配置文件的一点小东西
- Hibernate-配置文件-映射文件.hbm.xml
- hibernate.cfg.xml配置文件和hbm.xml配置文件
- Hibernate.cfg.xml注解和*.hbm.xml配置文件
- hibernate.cfg.xml注解和*.hbm.xml配置文件详解
- Hibernate3.5.4---java application的xml和annotation环境搭建(hibernate.cfg.xml配置文件说明,映射文件Student.hbm.xml说明
- Hibernate3.5.4---java application的xml和annotation环境搭建(hibernate.cfg.xml配置文件说明,映射文件Student.hbm.xml说明)
- xx实体.hbm.xml 配置文件的主键生成机制说明
- xx实体.hbm.xml 配置文件的主键生成机制说明
- hibernaet.hbm.xml配置文件
- *.hbm.xml 映射配置文件
- hibernate annotations和hbm.xml配置文件并存配置
- hibernate hbm.xml 配置文件中的主键生成策略
- hibernate annotations和hbm.xml配置文件并存配置
- C语言学习笔记整理
- uml 介绍
- 对话周鸿袆:从程序员创业谈起
- 实施ERP的重要评价因素
- 送给所有的共享新手
- hibernate hbm.xml配置文件说明
- 利用数据库模版创建方便部署的.Net项目调试环境
- 中国共享软件走向国际指南
- Eclipse 使用技巧
- 快毕业了
- OOJSing
- 一个月赚5万美元--周奕
- Asp.net与SQL一起打包部署安装
- 电子商务数据库实践!