This content has been marked as final.
Show 2 replies
-
1. Re: how to avoid duplicate constraints in mysql table
wdfink Nov 13, 2010 5:55 AM (in response to javatwo)Do you know to which table the CONSTRAINT is linked?
Also how your entity is annotated and how the deployment descriptor looks like?
- create / remove table by deploy
- anntotation of relation
-
2. Re: how to avoid duplicate constraints in mysql table
javatwo Dec 31, 2010 4:40 AM (in response to wdfink)public class Merchandise {
@ManyToOne
@JoinColumn(name="unit")
public Unit getUnit() {
return unit;
}}
public class Unit {
...
}
show create table Merchandise
CONSTRAINT `FK859C7BA3FBCB8305` FOREIGN KEY (`unit`) REFERENCES `unit` (`id`),
CONSTRAINT `FK859C7BA3FBCB8307` FOREIGN KEY (`unit`) REFERENCES `unit` (`id`)Hibernate: set "hibernate.hbm2ddl.auto" to "update".
How to tell Hibernate not to create such duplicate FOREIGN KEY constraints. Thanks for help.
Dave