Development/TypeORM
Active Record vs Data Mapper
Active Record는 Entity 객체(아래 예시에서는 User)가 BaseEntity 를 상속 받음 import {BaseEntity, Entity, PrimaryGeneratedColumn, Column} from "typeorm"; @Entity() export class User extends BaseEntity { // BaseEntity 상속 @PrimaryGeneratedColumn() id: number; @Column() firstName: string; @Column() lastName: string; @Column() isActive: boolean; } 위 예시를 Data Mapper 로 바꿔보면 BaseEntity 를 extends 하지 않음 import {Entity, Pr..
2020. 12. 26. 14:26
최근댓글