0
votes

My Grails application is using a shared legacy database. There are no foreign key constraints that are explicitly defined in the table schema. There are, however logical foreign key relationships present in the many of the tables. I am not allowed to change the DB schema (as it is shared DB, take permission from DBA... ...).

Is there a way to define the hasMany, ManytoMany and other GORM constraints without changing the existing Database schema?

1

1 Answers

0
votes

You can have hasMany and belongsTo without foreign keys. Cascade delete and all other things would work, but you wont get FK violations errors if your code does some thing which violates FK.