NestJS (1) 썸네일형 리스트형 [NestJS] TypeORM 관계(Relation) 정리 NestJS에서 TypeORM을 사용할 때 가장 많이 사용하는 관계 매핑을 예제 코드 중심으로 정리한 포스트이다. (개인 복습용으로 작성)1: 1 관계 설정 (UserEntity & ProfileEntity)한 명의 사용자(User)는 하나의 프로필(Profile)만 가질 수 있음.'@OneToOne' + '@JoinColumn' 사용.반드시 'JoinColumn'은 관계의 소유 측(owner side)에만 작성.// user.entity.ts@OneToOne(() => ProfileModel, (profile) => profile.user, { ...옵션 })profile: ProfileModel;// profile.entity.ts@OneToOne(() => UserModel, (user) => us.. 이전 1 다음