JiafanZhou
版主
发贴: 736
积分: 61
|
于 2007-11-30 23:23
yqf0215 wrote: HenryShanley 你好强,但确实很多时候,还是需要manytomany的啊,例如学生上课,一个学生上多门课,一门课有多个学生,如果改用2个manytoone,还是有些不方便啊
Nope, all the many-to-many relationships can all be simplified to many-to-one, and this is exactly Gavin King suggested us to do. And it is clearly stated in the "Hibernate in Action" book.
Try to map both ends <many-to-one> and see if this works. Let me know if this is still a problem for you.
Regards, Jiafan
When I was a kid I used to pray every night for a new bike. Then I realized that The Lord doesn't work that way, so I stole one and asked him to forgive me.
|