<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC 
	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.shuangyulin_QQ287307421.domain">

	<class name="Book" table="t_Book">

          <!-- 主键图书条形码 -->
          <id name="barcode" type="string" length="20">
            <generator class="assigned"/>
          </id>

          <!-- 简单字符串属性: 图书名称 -->
          <property
            name="bookName"
            column="bookName"
            type="string"
            length="20"
          />

          <!-- 多对一属性: 图书所在类别 -->
          <many-to-one name="bookType"
            column="bookType"
            class="BookType"
            lazy="false"
            outer-join="true"
            cascade="save-update"
          />

          <!-- 简单浮点型属性: 图书价格 -->
          <property
            name="price"
            column="price"
            type="float"
          />

          <!-- 简单整型属性: 库存 -->
          <property
            name="count"
            column="count"
            type="int"

          />

          <!-- 简单日期型属性: 出版日期 -->
          <property
            name="publishDate"
            column="publishDate"
            	type="string"
            	length="10"
          />

          <!-- 简单字符串属性: 出版社 -->
          <property
            name="publish"
            column="publish"
            type="string"
            length="20"
          />

          <!-- 简单字符串属性: 图书简介 -->
          <property
            name="introduction"
            column="introduction"
            type="string"
            length="500"
          />

          <!-- 简单图片属性: 图书图片 -->
          <property
            name="bookPhoto"
            column="bookPhoto"
            type="string"
            length="50"
          />


		 
		
	</class>
	
</hibernate-mapping>
 
