Uploaded image for project: 'Quarkus'
  1. Quarkus
  2. QUARKUS-3949

Fix Panache bytecode enhancement for `@Embeddable` records

    XMLWordPrintable

Details

    Description

      Fixes #36747

      I also added tests for `@Immutable` embeddables, because I thought Hibernate ORM might be skipping enhancement on those as well, but apparently it doesn't so everything works fine. I guess it makes sense as those classes, while they are declared as immutable, are still mutable from the point of view of Java, which still allows Hibernate ORM to implement lazy loading through bytecode enhancement. For records, while technically possible, that wouldn't be reasonable.

      @gsmet I think Quarkus 3.2 is affected as well, it's just that the `@Embeddable` isn't required on embeddables in Quarkus 3.2, so the person who reported the issue didn't have that `@Embeddable` annotation and didn't notice the problem. EDIT: Ah, well, they even [confirmed it affects 3.2 as well](https://github.com/quarkusio/quarkus/issues/36747#issuecomment-1832777450).
      That being said, backporting the test will be a pain, since we need JDK 17 for records. I kept the commits strictly separate, in case you want to simply backport without the test.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              olubyans@redhat.com Alexey Loubyansky
              Martin Ocenas Martin Ocenas
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: