Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: materialized path being computed as "undefined1." (#8526)
* fix: materialized path being computed as "undefined1." when tree entities are saved implicitly (through another related entity which hasMany tree-entities and "cascade" set to true) the ORM generates materialized-path strings prefixed with "undefined". Resulting in mpaths like "undefined1.2.3" * fix: materialized path being computed as "undefined1." removes it.only * fix: materialized path being computed as "undefined1." fixes unit tests * fix: materialized path being computed as "undefined1." Try to fix unit tests. * fixing failing test * fixing test * fixing test * fixing test * Update materialized-path.ts * Update materialized-path.ts Co-authored-by: Matthias Schwebler <m.schwebler@sportradar.com> Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
- Loading branch information
1 parent
93bf96e
commit 09f54e0
Showing
4 changed files
with
72 additions
and
7 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
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
23 changes: 23 additions & 0 deletions
23
test/functional/tree-tables/materialized-path/entity/Product.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,23 @@ | ||
import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn"; | ||
import {Entity} from "../../../../../src/decorator/entity/Entity"; | ||
import {Category} from "./Category"; | ||
import {OneToMany} from "../../../../../src/decorator/relations/OneToMany"; | ||
import {Column} from "../../../../../src/decorator/columns/Column"; | ||
|
||
@Entity() | ||
export class Product { | ||
|
||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
name: string; | ||
|
||
@OneToMany( | ||
() => Category, | ||
(category) => category.product, | ||
{ cascade: true }, | ||
) | ||
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