We are having issues with Grails where it ignores the nullable contraint in some cases. For example:
class SomeSetting {
...
Employee manager
...
static belongsTo = [ employee: Employee ]
static constaints = {
manager nullable: true
}
}
class Employee {
...
static hasOne = [ settings: SomeSetting ]
}
grails keeps on creating the database with the manager field being NOT NULL for the SomeSetting class. This is just a crude example. Does anyone have any idea how to fix this. We do not want to make the default value NOT NULL for fields.
Got it working by using
static mappedBy = [ ... ]