日期:2014-05-20 浏览次数:20788 次
<class name="Article" table="Article"> <id name="id" type="long" column="id"> <generator class="native"/> </id> <property name="title" column="title"/> <property name="keywords" column="keywords"/> <many-to-one name="catalog" lazy="true" class="Catalog"> <column name="article_id"></column> </many-to-one> <set name="comments" inverse="true" cascade="all" lazy="true"> <key column="article_id"/> <one-to-many class="Comment" /> </set> ... <joined-subclass name="News" table="News"> <key column="id"/> <property name="page" column="page"/> <property name="pagesize" column="pagesize"/> ... </joined-subclass> <joined-subclass name="Falsh" table="Falsh"> <key column="id"/> <property name="falshUrl" column="falshUrl"/> <property name="height" column="height"/> ... </joined-subclass> <joined-subclass name="Product" table="Product"> <key column="id"/> <property name="pname" column="pname"/> <property name="psize" column="psize"/> ... </joined-subclass> </class>
------解决方案--------------------
用hibernate自动生成工具生成bhm.xml等文件.