Skip to content
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

Support dependency injection in JPA AttributeConverter for EclipseLink [SPR-17159] #21696

Open
spring-issuemaster opened this issue Aug 10, 2018 · 4 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Aug 10, 2018

Marten Deinum opened SPR-17159 and commented

With JPA 2.2 it is finally possible to do injection into AttributeConverters. The standard describes that when using CDI that injection. It would be nice if when using Spring injection would be supported as well. 

JPA 2.1 introduced injecting in EntityListeners with CDI would be nice if injection would work for that as well. 

Added bonus would be if this would work with both JPA and plain Hibernate. 


Affects: 5.1 RC1

Reference URL: https://github.com/javaee/jpa-spec/issues/109

Issue Links:

  • #20852 Support Hibernate 5.3's ManagedBeanRegistry for dependency injection
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 10, 2018

Andrei Ivanov commented

I wonder if #20852 fixes this issue already. Or maybe this fixes the issue only when using Hibernate as the JPA implementation.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 10, 2018

Marten Deinum commented

Darn, missed that totally while investigating this in JIRA. This can be considered a duplicate I guess. 

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 10, 2018

Andrei Ivanov commented

As I said, this only works with Hibernate 5.3 :)
It might still be valid if you're not using Hibernate or an earlier version.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 10, 2018

Juergen Hoeller commented

Indeed, #20852 covers this for Hibernate already. Since we need a callback from the persistence provider here, we can only really do this in conjunction with specific SPI contracts... such as the one that we got in Hibernate 5.3. Otherwise, the best you can is do use @Configurable through AspectJ weaving.

I'll repurpose this ticket to the main missing part: JPA 2.2 injection support for EclipseLink.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.