1
我是学习hibernate的新手。我想在单个hibernate映射文件中映射两个表列。如何在单个hbm文件中映射两个表
我有两个表样本和例子。
我样品表已经3列样
->upc
->product name
->product url
和我的例子表有2列
-> price
-> product name
我试过这种方式,但它不是working.Please帮我解决我的问题。
谢谢。
<class name="Trail" table="sample">
<id name="upc" type="long">
<column name="upc" />
<generator class="identity" />
</id>
<property name="ProductName" type="string">
<column name="product name" not-null="true" />
</property>
<property name="Producturl" type="string">
<column name="producturl" not-null="true" />
</property>
<join table="Example">
<key column="productname"></key>
<property name="price" type="double" >
<column name="price"/>
</property>
</join>