-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The custom repository implementation should inherit the entity-manager-ref and transaction-manager-ref config [DATAJPA-18] #457
Comments
Oliver Drotbohm commented It's all about annotating your custom implementation with |
jokeway commented Yes, I know that Spring treatment, so I make the report as type 'Improvement'. Do not know whether this is a popular demand, but I think that allows me not to modify the code or the base class when switch entity manager factory. |
wims.tijd commented annotating custom implementation with it think it is not an improvement since the custom methods where querying the wrong database |
jokeway commented Has no plan to fix it? |
Oliver Drotbohm commented To be honest, no. The main reason I am hesitant to activate this is the fact that this would lead to a gap between what's annotated in the code and what actually is happening. Assume you have a configuration of
if you now annotate the repository interface as follows:
This is highly misleading as - if we follow the suggestion - we would need to trigger a transaction with Beyond that, we have exactly 2 votes for this so far, so I think most users value the alignment with |
Jens Schauder commented Batch closing resolved issue without a fix version and a resolution indicating that there is nothing to release (Won't fix, Invalid ...) |
jokeway opened DATAJPA-18 and commented
The Respository customImplementation is very common of using
@PersistenceContext
and@Transactional
to handle custom method. So the customImplementation should inject the 'right' transactionManager (as same as <jpa:repositories /> config).Use the default spring processing to create the bean is the simplest way, but also lost configurable.So I think we should 'replace' the customImplementation's PersistenceContext and Transactional by the <jpa:repositories /> config, especially when using the AutomaticJpaRepositoryConfigInformation.
3 votes, 4 watchers
The text was updated successfully, but these errors were encountered: