We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
创建两个实体
@Entity('animal_mymodel') export class AnimalMymodelEntity { @PrimaryGeneratedColumn() id: number; @Column({ comment: '描述' }) desc: string; @OneToMany(() => AnimalMymodelextEntity, ext => ext.model) public exts: AnimalMymodelextEntity[]; @Column({ comment: '创建时间' , nullable: true}) createTime: Date; }
@Entity('animal_mymodelext') export class AnimalMymodelextEntity { @PrimaryGeneratedColumn() id: number; @Column({ comment: '描述' }) xxx: string; @ManyToOne(()=> AnimalMymodelEntity, mymodel => mymodel.exts) @JoinColumn() model: AnimalMymodelEntity; }
主表的为AnimalMymodelEntity实体类里为什么没有exts字段?
The text was updated successfully, but these errors were encountered:
不要用外键
Sorry, something went wrong.
强烈建议查询多条数据连表的时候直接写 sql ,typeorm 限制太多
No branches or pull requests
使用cooladmin
创建两个实体
主表
从表
主表的为AnimalMymodelEntity实体类里为什么没有exts字段?
数据表
主表
从表
The text was updated successfully, but these errors were encountered: