class A {
B b
static constraints = {
b(nullable: true)
}
}
class B {
A a
static belongsTo = [A]
}
Grails generated the database schema in such way: table A has column b_id (as it has to be), but it cannot be nullable. As You can see for 1 to 0..1 relationship this is a wrong behavior. I posted question on Nabble forums (as I recommended to everyone:) ) and received answer that mentioned problem will be fixed in Grails 1.1. For more details visit appropriate forum post.
No comments:
Post a Comment