How do you prevent foreign keys from being generated in Grails 3?
In Grails 2 you would override the secondPassCompile() method of GrailsAnnotationConfiguration class and do something like this:
for(PersistentClass pc : classes.values()) {
for(Iterator iterator = pc.getTable().getForeignKeyIterator(); iterator.hasNext(); ) {
ForeignKey fk = (ForeignKey) iterator.next();
iterator.remove();
}
}
- How would I achieve the same using Grails 3.2.3 with Hibernate 5?
- What about using Grails 3.2.3 with Hibernate 4?
The GORM docs mentioned that GrailsAnnotationConfiguration has been replaced with HibernateContextMappingConfiguration but I am unable to make it work.