typeorm(2)
-
TypeORM Relations
Relations 관계형 Entity 설계 1:1 : @OneToOne N:1 : @ManyToOne 1:N : @OneToMany N:N : @ManyToMany One-To-One 서로 1:1로만 매칭이 되는 모델에 사용 관계 설정 @OneToOne Target Type을 지정하여 연결 설정 단방향/양방향 설정 가능 단방향 : 한쪽에만 설정 양방향 : 양쪽에 설정 @JoinColumn 관계 중 Foreign Key가 있는 쪽에 설정 필수 설정된 테이블에 "relation id"와 foreign key가 저장됨 import {Entity, PrimaryGeneratedColumn, Column} from "typeorm"; @Entity() export class Profile { @PrimaryGen..
2020.10.04 -
TypeORM Pattern
TypeORM이란? TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7, ES8). Its goal is to always support the latest JavaScript features and provide additional features that help you to develop any kind of application that uses databases - from small applicati..
2020.10.02