* Get the identity value for a given entity instance or entity data object. * * @param entityOrData - The data object for which to determine the identity * value.
(entityOrData: AnyObject)
| 452 | * value. |
| 453 | */ |
| 454 | static getIdOf(entityOrData: AnyObject): any { |
| 455 | if (typeof entityOrData.getId === 'function') { |
| 456 | return entityOrData.getId(); |
| 457 | } |
| 458 | |
| 459 | const idName = this.getIdProperties()[0]; |
| 460 | return entityOrData[idName]; |
| 461 | } |
| 462 | |
| 463 | /** |
| 464 | * Get the identity value. If the identity is a composite key, returns |
no test coverage detected