Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed persistence flag bug in relation metadata, more tests for #1319
- Loading branch information
Umed Khudoiberdiev
committed
Dec 13, 2017
1 parent
86ac41f
commit 8c4933a
Showing
5 changed files
with
110 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
test/functional/entity-metadata-validator/initialized-relations/entity/Image.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {Entity} from "../../../../../src/decorator/entity/Entity"; | ||
import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn"; | ||
import {Column} from "../../../../../src/decorator/columns/Column"; | ||
import {ImageInfo} from "./ImageInfo"; | ||
import {OneToMany} from "../../../../../src/decorator/relations/OneToMany"; | ||
|
||
@Entity() | ||
export class Image { | ||
|
||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
title: string; | ||
|
||
@OneToMany(type => ImageInfo, imageInfo => imageInfo.image) | ||
informations: ImageInfo[] = []; | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
test/functional/entity-metadata-validator/initialized-relations/entity/ImageInfo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {Entity} from "../../../../../src/decorator/entity/Entity"; | ||
import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn"; | ||
import {Column} from "../../../../../src/decorator/columns/Column"; | ||
import {ManyToOne} from "../../../../../src/decorator/relations/ManyToOne"; | ||
import {Image} from "./Image"; | ||
|
||
@Entity() | ||
export class ImageInfo { | ||
|
||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
name: string; | ||
|
||
@ManyToOne(type => Image, image => image.informations) | ||
image: Image; | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
test/functional/entity-metadata-validator/initialized-relations/entity/Question.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {Entity} from "../../../../../src/decorator/entity/Entity"; | ||
import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn"; | ||
import {Column} from "../../../../../src/decorator/columns/Column"; | ||
import {ManyToMany} from "../../../../../src/decorator/relations/ManyToMany"; | ||
import {Category} from "./Category"; | ||
import {JoinTable} from "../../../../../src/decorator/relations/JoinTable"; | ||
|
||
@Entity() | ||
export class Question { | ||
|
||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
title: string; | ||
|
||
@ManyToMany(type => Category, { persistence: false }) | ||
@JoinTable() | ||
categories: Category[] = []; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters