Builds join column for the many-to-one and one-to-one owner relations.
Cases it should cover:
when join column is set with custom name and without referenced column name
we need automatically set referenced column name - primary ids by default
joincolumn({
name: "custom_name" })
when join column is set with only referenced column name
we need automatically set join column name - relation name + referenced column name
joincolumn({
referencedColumnName: "title" })
when join column is set without both referenced column name and join column name
we need to automatically set both of them
joincolumn()
when join column is not set at all (as in case of @ManyToOne relation)
we need to create join column for it with proper referenced column name and join column name
when multiple join columns set none of referencedColumnName and name can be optional
both options are required
Since for many-to-one relations having JoinColumn decorator is not required,
we need to go thought each many-to-one relation without join column decorator set
and create join column metadata args for them.
Builds join column for the many-to-one and one-to-one owner relations.
Cases it should cover:
name: "custom_name" })
referencedColumnName: "title" })
when join column is not set at all (as in case of @ManyToOne relation) we need to create join column for it with proper referenced column name and join column name
when multiple join columns set none of referencedColumnName and name can be optional both options are required
{ name: "category_title", referencedColumnName: "type" }, { name: "category_title", referencedColumnName: "name" },
])
Since for many-to-one relations having JoinColumn decorator is not required, we need to go thought each many-to-one relation without join column decorator set and create join column metadata args for them.