But still I can use the EntityManager like:
EntityManager
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.
em
Thank you for the great response sir.
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).
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
But still I can use the
EntityManager
like: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.
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).