<?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.simplye.hibernate">
<class name="Animal" table="t_animal"> //可以设置抽象类,使抽象类不被创建 abstruct="true"
<id name="id">
<generator class="uuid"/> //或者手动生成assigned
</id>
<property name="name"/>
<property name="sex"/>
<union-subclass name="Pig" table="t_pig">
<property name="weight"/>
</union-subclass>
<union-subclass name="Brid" table="t_brid">
<property name="height">
</union-subclass>
</class>
</hibernate-mapping>
posted @
2009-03-02 01:26 simplye 阅读(164) |
评论 (0) |
编辑 收藏
<?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.simplye.hibernate">
<class name="Animal" table="t_animal">
<id name="id">
<generator class="native"/>
</id>
<property name="name"/>
<property name="sex"/>
<joined-subclass name="Pig" table="t_pig">
<key column="pig"/>
<property name="weight"/>
</joined-subclass>
<joined-subclass name="Bird" table="t_brid">
<key column="brid"/>
<property name="height"/>
</joined-subclass>
</class>
</hibernate-mapping>
posted @
2009-03-01 22:46 simplye 阅读(326) |
评论 (0) |
编辑 收藏
<?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.simplye.hibernate">
<class name="Animal" table="t_animal">
<id name="id">
<generator class="native"/>
</id>
<discriminator column="type" type="string"/>
<property name="name"/>
<property name="sex"/>
<subclass name="Pig" discriminator-value="P">
<property name="weight"/>
</subclass>
<subclass name="Bird" discriminator-value="B">
<property name="height" />
</subclass>
</class>
</hibernate-mapping>
posted @
2009-03-01 22:38 simplye 阅读(133) |
评论 (0) |
编辑 收藏
开始BBS小程序,记录问题与知识点
posted @
2008-12-15 15:57 simplye 阅读(82) |
评论 (0) |
编辑 收藏