我用Hibernate,有三个实体Student 多对一 Tutor
Fee 多对一 Student
Fee 多对一 Tutor三个实体用annotation进行耦合,然后通过Hibernate自动生成数据库,
但是在生成好的Fee表,本来应该关联着2个外键(即student_id, tutor_id),
但是由于Student又与Tutor是多对一,它自动又多出来个外键----tutor_id,
即现在有三个外键了(student_id,tutor_id,tutor_id)
怎样才能消除第三个外键关联啊?
Fee 多对一 Student
Fee 多对一 Tutor三个实体用annotation进行耦合,然后通过Hibernate自动生成数据库,
但是在生成好的Fee表,本来应该关联着2个外键(即student_id, tutor_id),
但是由于Student又与Tutor是多对一,它自动又多出来个外键----tutor_id,
即现在有三个外键了(student_id,tutor_id,tutor_id)
怎样才能消除第三个外键关联啊?
解决方案 »
- JFreeChart柱状图中如何取消柱子的倒影
- affuse中如何其它引用包
- struts2中的验证框架问题
- 如何禁用目录树
- Spring+Hibernate+Dwr里出错:Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL):
- Tomcat服务器问题
- 求解决升级struts2-core-2.3.14.2.jar报错
- java中对数据库的操作,不知所措!!高手请进!
- spring实例化和使用new
- java多线程问题
- struts上传文件时每次写多少字节
- 请教为何调用webservice后session过期?
刚刚引用hibernate的时候就不要设置关联然后用sql语句来控制关联这样比较方便,也不容易出错。