To do this you have to use decorator @RelationId
like this:
export class Province {
//...
@Column()
@RelationId((province: Province) => province.country)
public countryId: number;
}
Please use next time block code with code definition.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.