| 64 | } |
| 65 | |
| 66 | static notEntity(owner: AnyEntity, prop: EntityProperty, data: any): ValidationError { |
| 67 | const type = /\[object (\w+)]/.exec(Object.prototype.toString.call(data))![1].toLowerCase(); |
| 68 | return new ValidationError( |
| 69 | `Entity of type ${prop.type} expected for property ${owner.constructor.name}.${prop.name}, ${inspect(data)} of type ${type} given. If you are using Object.assign(entity, data), use em.assign(entity, data) instead.`, |
| 70 | ); |
| 71 | } |
| 72 | |
| 73 | static notDiscoveredEntity(data: any, meta?: EntityMetadata, action = 'persist'): ValidationError { |
| 74 | /* v8 ignore next */ |