Created
January 1, 2014 05:16
-
-
Save MangoLiu/8205303 to your computer and use it in GitHub Desktop.
Hibernate mapping file (Hibernate 映射文件:classname.hbm.xml)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding='UTF-8'?> | |
<!DOCTYPE hibernate-mapping PUBLIC | |
"-//Hibernate/Hibernate Mapping DTD 3.0//EN" | |
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > | |
<!-- 以上4行,所有的配置xml文件都一样。 --> | |
<hibernate-mapping package="包名"> | |
<class name="类名" table="表名"> <!-- 每个class元素对应一个持久化对象,即一个数据表。 --> | |
<!-- id元素定义持久化类的标识属性。 --> | |
<id name="类中的字段名" column="对应表中字段" type="类型 "> | |
<generator class="identity"/><!-- 主键生成策略 --> | |
</id> | |
<!-- property元素定义常规属性。 --> | |
< property name = "类中的其他字段"/> | |
< property name = "类中的其他字段"/><!-- 可以有很多。 --> | |
</class> | |
</hibernate-mapping> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment