TypeORM
# TypeORM
# 1.装饰器
# 1.1.实体
- @Entity
- name
- database
- schema
- engine
- synchronize
- orderBy
- @ViewEntity (视图实例)
- name
- database
- schema
- expression (必填)
# 1.2.字段
- @Column
- @PrimaryColumn
- @PrimaryGeneratedColumn
- @ObjectIdColumn
- @CreateDateColumn
- @UpdateDateColumn
- @DeleteDateColumn
- @VersionColumn
- @Generated
- @VirtualColumn
# 1.3.关系
- @OneToOne
- @ManyToOne
- @OneToMany
- @ManyToMany
- @JoinColumn
- @JoinTable
- @RelationId
# 1.4.订阅监听
- @AfterLoad
- @BeforeInsert
- @AfterInsert
- @BeforeUpdate
- @AfterUpdate
- @BeforeRemove
- @AfterRemove
- @BeforeSoftRemove
- @AfterSoftRemove
- @BeforeRecover
- @AfterRecover
- @EventSubscriber
# 1.5.其他
- @Index
- @Unique
- @Check
- @Exclusion
编辑 (opens new window)