You create a unidirectional one-to-one relationship between
The following example defines an Employee model and an Address model:
Let's add a one-to-one relationship with a foreign key to Employee.
To define it, use ModelRef<ModelType>.
The following error will be shown for addressRef field:
Use quick fix(hold down CTRL+1) and select "Create getter and setter for 'addressRef'".
The following error will be shown for setAddressRef method:
As the message says, define addressRef field and delete setAddressRef method.
Now let's create an employee and an address.
You can get an employee and an address. The relationship is loaded lazily.
Continue to Bidirectional One-to-One Relationships.