TypeORM RepositoryNotFoundError:找不到%%的存储库。如何使用模式注册存储库

时间:2019-03-08 05:31:51

标签: node.js typescript typeorm

我使用TypeORM我使用“实体模式”定义我的实体,在一个文件中我定义了我的实体

  

./ enteties / catalago.entity.ts

export const CarreraEntity = new EntitySchema<Carrera>({
name: 'carrera',
columns: {
    id: {
        type: Number,
        generated: 'increment',
        primary: true
    },
    text: {
        type: String
    }
}});

在其他文件中,我定义了自己的模式

  

./ enteties / catalog.schemas.ts

export abstract class Catalogs {
id: number;
text: string;}
export class Carrera extends Catalogs {}

但是当我跑步时,出现错误

  

RepositoryNotFoundError:找不到“ Carrera”的存储库。看起来该实体未在当前的“默认”连接中注册?

id docs不清楚在何处注册实体

0 个答案:

没有答案
相关问题