views:

20

answers:

0

I'm using SchemaUpdate to synchronize my hbms with existing database. Database has recently created based on hbms and is completely up-to-date. But SchemaUpdate generates all foreign key constraints again.

For example suppose you have Student and Teacher. Student has association to Teacher with name ArtTeacher. ArtTeacher is a foreign key from Student to Teacher. Suppose database is up-to-date and currently holde Student, Teacher and their foreign key relation. So HBM and Database are equivalent. Know SchemaUpdate must not do anything but when I see its generated scripts, it re-produce that foreign key again.

Why this happens? Is there any way to avoid it?