我有这个实体类:
@Entity("organization")
export class OrganizationEntity {
// ...
@PrimaryColumn({name: "party_id"})
@OneToOne(() => PartyEntity, {cascade: true})
@JoinColumn({name: "party_id", referencedColumnName: "id"})
party: PartyEntity
}
然后我创建一个新的OrganizationEntity
并坚持下去:
const savedOrganizationEntity = await this.organizationTypeOrmRepository.save(organizationEntity);
// see Repository.save
但是,返回的savedOrganizationEntity
在现场聚会中包含一个字符串,而不是PartyEntity
对象。
如何解决此问题,以便OrganizationEntity.party
包含PartyEntity
,而不是字符串?