- Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
has: votes-jiraIssues migrated from JIRA with more than 10 votes at the time of importIssues migrated from JIRA with more than 10 votes at the time of importin: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)type: documentationA documentation taskA documentation task
Milestone
Description
Oliver Drotbohm opened SPR-10443 and commented
Currently you can inject any Spring bean into clients through constructor injection. A JPA EntityManager is an exception to that. Constructor injection has the benefit of being able to design classes in an immutable way. Also, you communicate required dependencies through it easily. Sadly, @PersistenceContext cannot be used on a constructor parameter and this probably won't change befor JPA 2.2 (giving 2.1 is close to final).
It would be cool to simply be able to inject EntityManager instances through either @Autowired or @Inject.
Issue Links:
- DATAJPA-445 Enable support to inject EntityManager via constructor
12 votes, 17 watchers
nigredo-tori, asaikali, elab, hiddewie, csc-bnguyen43 and 5 morexerx593
Metadata
Metadata
Assignees
Labels
has: votes-jiraIssues migrated from JIRA with more than 10 votes at the time of importIssues migrated from JIRA with more than 10 votes at the time of importin: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)type: documentationA documentation taskA documentation task