Skip to content

Conversation

@B4nan
Copy link
Member

@B4nan B4nan commented Dec 13, 2019

Previously all entities had internal reference to the root EM - the one created when
initializing the ORM. Now only managed entities (those merged to the EM, e.g. loaded
from the database) have this internal reference.

To use assign() method on new (not managed) entities, you need to provide the em
parameter:

const book = new Book();
wrap(book).assign(data, { em: orm.em });

Closes: #267

Previously all entities had internal reference to the root EM - the one created when
initializing the ORM. Now only managed entities (those merged to the EM, e.g. loaded
from the database) have this internal reference.

To use `assign()` method on new (not managed) entities, you need to provide the `em`
parameter:

```typescript
const book = new Book();
wrap(book).assign(data, { em: orm.em });
```

Closes: #267
@B4nan B4nan merged commit d09c3ab into master Dec 14, 2019
@B4nan B4nan deleted the internal-em branch December 14, 2019 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IdentifiedRef.load broke in 3.0.0-rc.1

2 participants