-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Milestone
Description
Description
As far as I understand it, the repository finder methods return POJOs and not managed entities. In order to integrate with existing JPA codebases, it would be very useful if managed entities were returned.
As a:
- Application user/user of the configuration itself
- API user (application developer)
- SPI user (container or runtime developer)
- Specification implementer
All that would be needed is a reference to EntityManager. I propose to infer EntityManager from CDI,
similar to what's implemented here: https://docs.flowlogix.com/#section-daohelper
@Inject
// Inject default EntityManager
@EntityManagerSelector
MyRepository<Entity, Key> repository;
@Inject
@EntityManagerSelector(NonDefaultEM.class)
MyRepository<Entity, Key> repository;
where NonDefaultEM is a custom @Qualifier annotation that points to a producer method that injects the appropriate EM.
Default would be no-qualifier injection, which would work in most cases.
Metadata
Metadata
Assignees
Labels
No labels