Baen属性
1
2
3
4
5
6
7
|
One.java
private
List<Many> manyList =
new
ArrayList<Many>();
Many.java
private
One oneId;
|
hbm.xml
1
2
3
4
5
6
7
8
9
|
ont.hbm.xml
<
list
name
=
"manyList"
cascade
=
"all"
>
<
key
column
=
"one_id"
></
key
>
<
index
column
=
"id"
/>
<
one-to-many
class
=
"com.wondersgroup.mchis.wom.entity.Many"
/>
</
list
>
many.hbm.xml
<
many-to-one
name
=
"oneId"
class
=
"com.wondersgroup.mchis.wom.entity.One"
column
=
"one_id"
></
many-to-one
>
|
本文转自 沫沫金 51CTO博客,原文链接:http://blog.51cto.com/zl0828/1564074,如需转载请自行联系原作者