Skip to content

AbstractMapping.getPersistentEntity(Class<?> type) fails to lookup the PersistentEntity when the provided type is a HibernateProxy #2383

Closed

Description

@alienisty

From my analysis, the regression has been added by commit c866b4202527b3acc64e7cc205a98a8aa754cb59 where "ClassTypeInformation now never unwraps the user type to consistently work with the type originally presented in the lookup..."

The assumption in that comment might be incorrect, I would be surprised if PersistentEntity instances are mapped against an HibernateProxy class.

I believe that at least ClassTypeInformation.from(Class type) should have retained the type unwrapping.

This is a minimal demonstrating project which also shows the impact on Spring Data REST
demo.zip

Activity

  1. mp911de commented on Nov 24, 2021

    @mp911de
    Member

    The change is more invasive than anticipated. Prior the unwrapping change, looking up the persistent entity using the proxy type worked because ClassTypeInformation unwrapped the type before constructing TypeDiscoverer. That has led to the successful lookup through the proxy. We need to fix this regression.

  2. self-assigned this
    on Nov 29, 2021
  3. changed the title [-]AbstractMapping.getPersistentEntity(Class<?> type) fails to lookup the PersistentEntity when the provided type is a HibernateProxy[/-] [+]`AbstractMapping.getPersistentEntity(Class<?> type)` fails to lookup the `PersistentEntity` when the provided type is a `HibernateProxy`[/+] on Dec 8, 2021
  4. mp911de commented on Dec 8, 2021

    @mp911de
    Member

    I transferred the ticket into the JPA project as we can easily fix the issue here.

  5. added a commit that references this issue on Dec 8, 2021
  6. added this to the 2.6.1 (2021.1.1) milestone on Dec 8, 2021
  7. added 2 commits that reference this issue on Dec 8, 2021
    3f97f1b
    2ca8273
  8. added a commit that references this issue on Oct 12, 2024
    a052065
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions