Skip to content

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

Closed as not planned

Description

@spring-projects-issues

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:

Activity

  1. spring-projects-issues commented on Aug 10, 2018

    @spring-projects-issues
    CollaboratorAuthor

    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.

  2. spring-projects-issues commented on Aug 10, 2018

    @spring-projects-issues
    CollaboratorAuthor

    Marten Deinum commented

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

  3. spring-projects-issues commented on Aug 10, 2018

    @spring-projects-issues
    CollaboratorAuthor

    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.

  4. spring-projects-issues commented on Aug 10, 2018

    @spring-projects-issues
    CollaboratorAuthor

    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.

  5. added
    in: data
    type: enhancement
    on Jan 11, 2019
  6. wilx commented on Apr 25, 2021

    @wilx

    We use Eclipselink. It would be nice to have this. I wanted to use the converters for transparent encryption/decryption of some of the fields in entities but to do that I need to have access to some Spring beans.

  7. jhoeller commented on Jan 3, 2024

    @jhoeller
    Contributor

    Since eclipse-ee4j/eclipselink#1089 has not got any traction, we're closing this issue from Spring's side.

  8. added
    status: declined
    on Jan 3, 2024
  9. removed this from the 6.x Backlog milestone on Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: datastatus: declinedtype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions