docs: update the content of one-to-one to be more grammatically complete (#10645)

This commit is contained in:
Mansur Ibrahim Nok 2024-01-26 06:34:40 +01:00 committed by GitHub
parent d3a2e53801
commit b67ae360f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,11 +44,11 @@ export class User {
}
```
Here we added `@OneToOne` to the `user` and specify the target relation type to be `Profile`.
Here we added `@OneToOne` to the `user` and specified the target relation type to be `Profile`.
We also added `@JoinColumn` which is required and must be set only on one side of the relation.
The side you set `@JoinColumn` on, that side's table will contain a "relation id" and foreign keys to target entity table.
The side you set `@JoinColumn` on, that side's table will contain a "relation id" and foreign keys to the target entity table.
This example will produce following tables:
This example will produce the following tables:
```shell
+-------------+--------------+----------------------------+
@ -68,7 +68,7 @@ This example will produce following tables:
+-------------+--------------+----------------------------+
```
Again, `@JoinColumn` must be set only on one side of relation - the side that must have the foreign key in the database table.
Again, `@JoinColumn` must be set only on one side of the relation - the side that must have the foreign key in the database table.
Example how to save such a relation: