<!-- ~ Hibernate, Relational Persistence for Idiomatic Java ~ ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later. ~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. --> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <!-- package声明pojo类所在的包,如果不这么写则要在class中需要指明pojo类所在的包 schema指数据库模式一个模式下可以有多张表 --> <hibernate-mapping package="cn.siggy.pojo"> <!-- class类映射一个pojo(实体/vo)类: 提供了公共的无参构造方法(通过反射产生对象), 属性用private修饰, 并且生成对应的get/set方法, 类不能用final修饰,因为hibernate会产生代理类(cglib), 类需要指明标识,name表示pojo类名,table表名,如果不写是类名 --> <class name="cn.siggy.pojo.User" table="user"
Hibernate mapping resource 详解
最新推荐文章于 2019-07-26 16:13:13 发布