The resulting tables created dont have a foreign key mapping of ar_entitlement table to resource table, it does create a column called 'resource_id' but without foreign key constraint. I need it to be pointing to id column of resource table
I tried several options, not having the belongsto specifier, using hasOne (in both domain classes) but not getting required foreign key relationship.
Re: creating domain classes with one-to-one relationship issue
The issue is partly solved,
The 'id' - primary key of 'resource' table is unsigned, and in my arEntitlement domain class where I have a field like "Resources resource" or even using the 'belongsTo = [resource:Resources]' clause it creates the resource_id field which is not unsigned, and thats why the next step of creating the foreign key constraint is failing ..
I manually changed resource_id field in the ar_entitlement table to be unsigned (after domain class was created) and then ran the foreign key constraint query from the error log directly in mysql then its successful.
I want to know now how to specify unsigned for resource field in the domain class itself ..