database-schema

NHibernate SchemaUpdate adding existing foreign keys again?

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 ...

How to set uniqueness at DB level for a one-to-many association?

My problem is simple but I could not find any GORM syntax for this. Consider the following class: class Article { String text static hasMany = [tags: String] static constraints= { tags(unique: true) //NOT WORKING } } I want to have one unique tag name per article defined in my constraints but I cannot make it with the ...