Skip to content

Commit

Permalink
Use a "Many" association for gorm instead of the reverse pointer (for…
Browse files Browse the repository at this point in the history
… the front)

Fixes #433 - manual
  • Loading branch information
thomaspeugeot committed Oct 17, 2023
1 parent 35962d0 commit 0d9f2be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 7 additions & 1 deletion test2/ng/projects/test2/src/lib/a-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@ export class ADB {
Name: string = ""

// insertion point for other declarations
Bs?: Array<BDB>
Bs: Array<BDB> = []

APointersEncoding: APointersEncoding = new APointersEncoding
}

export class APointersEncoding {
Bs: number[] = []
}
4 changes: 1 addition & 3 deletions test2/ng/projects/test2/src/lib/front-repo.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,8 @@ export class FrontRepoService {
// insertion point sub sub template for ONE-/ZERO-ONE associations pointers redeeming

// insertion point for redeeming ONE-MANY associations

let IntSlice_Bs = a.Bs! as unknown as number[]
a.Bs = new Array<BDB>()
for (let _bID of IntSlice_Bs) {
for (let _bID of a.APointersEncoding.Bs) {
let _b = this.frontRepo.Bs.get(_bID)
if (_b != undefined) {
a.Bs.push(_b)
Expand Down

0 comments on commit 0d9f2be

Please sign in to comment.