My code looks something like
class Person {
Nose nose
}
class Nose {
static belongsTo = [person:Person]
}
This is supposed to create a foreign key column for Nose on the 'person' table and also a back reference column for Person on the 'nose' table right?
There is no column generated for the back reference on the 'nose' table for me right now and I was wondering if this is normal...
http://grails.org/doc/latest/ref/Domain%20Classes/belongsTo.html (Seems like this is what the documentation is saying, but I'm thinking I'm interpreting it wrong)
edit: i edited the code snippet because i wrote the wrong thing down (haven't had coffee today)
You should reference the Person in the Nose, not Nose itself, like this:
EDIT AFTER COMMENT: ah, I see. Now that I am reading your question again, were you expecting to have both a
person_id
column inNose
andnose_id
column inPerson
? Because that will never happen in GORM, at least not automatically - for your schema, only thePerson
table will contain anose_id
column per documentation.