<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- package表示封装类的包路径 -->
<hibernate-mapping package="org.fh.jq.model">
<!-- 主表 -->
<class name="Book" table="t_Book">
<id name="bookno" column="t_bookno">
<generator class="native"></generator>
</id>
<property name="bookname" column="t_bookname"></property>
<property name="bookprice" column="t_bookprice" ></property>
<property name="bookstock" column="t_bookstock"></property>
<property name="booksales" column="t_booksales" ></property>
<property name="pubdate" column="t_pubdate"></property>
<property name="fileNmae" column="t_fileNmae"></property>
<many-to-one name="type" column="t_typeId" class="Type" lazy="false"></many-to-one>
<many-to-one name="publisher" column="t_publisherId" class="Publisher" lazy="false"></many-to-one>
</class>
<!-- 类型表 -->
<class name="Type" table="q_Type">
<id name="typeId" column="t_typeId">
<generator class="native"></generator>
</id>
<property name="typeName" column="t_typeName"></property>
</class>
<!-- 类型表 -->
<class name="Publisher" table="q_Publisher">
<id name="publisherId" column="t_publisherId">
<generator class="native"></generator>
</id>
<property name="publisherName" column="t_publisherName"></property>
</class>
</hibernate-mapping>```
hbm.xml
最新推荐文章于 2023-04-28 09:08:48 发布