* Get the identity as an object, such as `{id: 1}` or * `{schoolId: 1, studentId: 2}`
()
| 484 | * `{schoolId: 1, studentId: 2}` |
| 485 | */ |
| 486 | getIdObject(): Object { |
| 487 | const definition = (this.constructor as typeof Entity).definition; |
| 488 | const idProps = definition.idProperties(); |
| 489 | const idObj = {} as any; |
| 490 | for (const idProp of idProps) { |
| 491 | idObj[idProp] = (this as AnyObject)[idProp]; |
| 492 | } |
| 493 | return idObj; |
| 494 | } |
| 495 | |
| 496 | /** |
| 497 | * Build the where object for the given id |
no test coverage detected