knox ha revisionato questo gist . Vai alla revisione
1 file changed, 11 insertions
TypeORM-readme-40.ts(file creato)
@@ -0,0 +1,11 @@ | |||
1 | + | import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from "typeorm" | |
2 | + | import { PhotoMetadata } from "./PhotoMetadata" | |
3 | + | import { Author } from "./Author" | |
4 | + | ||
5 | + | @Entity() | |
6 | + | export class Photo { | |
7 | + | /* ... other columns */ | |
8 | + | ||
9 | + | @ManyToOne(() => Author, (author) => author.photos) | |
10 | + | author: Author | |
11 | + | } |
Più nuovi
Più vecchi