DEV Community

Discussion on: Introducing MikroORM, TypeScript data-mapper ORM with Identity Map

Collapse
 
artoodeeto profile image
aRtoo

But still I can use the EntityManager like:

class User extends EntityManage {
}

User.findOne(User, 1)

I'm asking this because instead of importing em each time you want to access an Entity would be cumbersome. Instead, I can just extend its static methods.

Thank you for the great response sir.

Thread Thread
 
b4nan profile image
Martin Adámek

No, as I said, this is not supported. You need to have an instance of entity manager (one per each request) as it holds the state (identity map).