node.js - 获取 typeORM 中实体的关系列表?
问题描述
我正在使用带有 typeORM 的存储库模式。对于下面这样定义的实体
@Entity()
export class Apple extends BaseEntity {
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
createdDate: Date;
@ManyToOne((type) => xyz, (xyz) => xyz.fruit)
@JoinColumn({ name: 'fruit' })
fruit: Fruit;
@ManyToOne((type) => ABC, (abc) => abc.juice)
@JoinColumn({ name: 'juice' })
juice: Juice;
}
有没有办法获取所有关系的列表,即像格式 ['fruit','juice'] 这样的数组
解决方案
推荐阅读
- spring-kafka - 使用 Embedded Kafka 测试 Kafka Streams 应用程序
- javascript - 仅当我运行 webpack --watch 时出现“ReferenceError:文档未定义”?
- wysiwyg - 在使用 SummerNote 编辑器的“插入图像”时,我可以在我的服务器上对目录进行硬编码以插入图像吗
- python - Django:: 无法更新表单
- python - 为什么合并的文件会比其输入文件少一行?
- wordpress - 将 woocommerce 结帐字段设为只读
- python - 在 3d 线上为给定 z 插入 xy 值的最快方法
- laravel - 请求通过但不更新数据库
- xquery - 在 VSC 中打开 MarkLogic API Doc 上下文相关帮助
- java - 如何从 ant antfile 任务中获取属性