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

Add support for Jakarta annotations + Jakarta persistence (in jakarta.* packages) #2612

Closed
ePaul opened this issue Jun 9, 2020 · 6 comments · Fixed by #2677 or #2726
Closed

Add support for Jakarta annotations + Jakarta persistence (in jakarta.* packages) #2612

ePaul opened this issue Jun 9, 2020 · 6 comments · Fixed by #2677 or #2726
Assignees
Labels
Milestone

Comments

@ePaul
Copy link

ePaul commented Jun 9, 2020

Currently, when building a project with QueryDSL-APT 4.3.1 and jakarta.annotation-api 2.0.0-RC1, no Q-classes are generated (with an error message like "java.lang.NoClassDefFoundError: javax/annotation/Generated"). It still works with jakarta.annotation-api 1.3.5.

With Jakarta EE, many types in the javax.* package are moved to the jakarta.* packages.
This includes the Annotation types in javax.annotations, and it looks like javax.annotation.Generated is now jakarta.annotation.Generated.

The same happens when using jakarta.persistence-api 3.0.0-RC2 (instead of 2.2.3), here the problem is javax.persistence.Entity → jakarta.persistence.Entity.

@ePaul ePaul changed the title Add support for jakarta annotations (in jakarta.annotations package) Add support for jakarta annotations (in jakarta.annotation package) Jun 9, 2020
@ePaul ePaul changed the title Add support for jakarta annotations (in jakarta.annotation package) Add support for Jakarta annotations + Jakarta persistence (in jakarta.* packages) Jun 9, 2020
@jwgmeligmeyling
Copy link
Member

Seems that a solution for #2657 would actually solve the issue w.r.t. @Generated.

I'm not really interested in supporting the jakarta.persistence.Entity annotations before any of the ORMs have actually implemented it. But eventually it would require a separate APT module.

@gitmotte
Copy link

EclipseLink 3.0 is out since Dec 8th, 2020 which implements jakarta-persistence-api 3.0

jwgmeligmeyling added a commit that referenced this issue Jan 17, 2021
Fixes #2460
Fixes #2612
Fixes #2242
Closes #2657

Co-authored-by: Jan-Willem Gmelig Meyling <jan-willem@youngmediaexperts.nl>
jwgmeligmeyling added a commit that referenced this issue Jan 17, 2021
Fixes #2460
Fixes #2612
Fixes #2242
Closes #2657

Co-authored-by: Jan-Willem Gmelig Meyling <jan-willem@youngmediaexperts.nl>
jwgmeligmeyling added a commit that referenced this issue Jan 17, 2021
Fixes #2460
Fixes #2612
Fixes #2242
Closes #2657

Co-authored-by: Jan-Willem Gmelig Meyling <jan-willem@youngmediaexperts.nl>
jwgmeligmeyling added a commit that referenced this issue Jan 18, 2021
Fixes #2460
Fixes #2612
Fixes #2242
Closes #2657

Co-authored-by: Jan-Willem Gmelig Meyling <jan-willem@youngmediaexperts.nl>
@gitmotte
Copy link

gitmotte commented Jan 18, 2021

I'm not really interested in supporting the jakarta.persistence.Entity annotations before any of the ORMs have actually implemented it. But eventually it would require a separate APT module.

@jwgmeligmeyling Please reopen this feature request. There will be no way around supporting jakarta.persistence in the future.
EclipseLink 3.0 is out since Dec 8th, 2020 which implements jakarta-persistence-api 3.0

@jwgmeligmeyling
Copy link
Member

Issue was automatically closed when I fixed the other issue the TS asked for: Java 9+ support.

I am working on full Jakarta EE API support in #2726

jwgmeligmeyling added a commit that referenced this issue Jan 24, 2021
[#2612] Support Jakarta EE through Eclipse Transformer
@jwgmeligmeyling jwgmeligmeyling self-assigned this Jun 8, 2021
@jwgmeligmeyling jwgmeligmeyling added this to the 5.0 milestone Jun 8, 2021
@hohwille
Copy link

hohwille commented Aug 7, 2023

Can someone shed a light how this can be solved if you are still using javax.persistence.EntityManager?

import javax.persistence.EntityManager;

@hohwille
Copy link

hohwille commented Aug 7, 2023

OK, I found it myself hidden in a different issue:

   <dependency>
      <groupId>com.querydsl</groupId>
      <artifactId>querydsl-jpa</artifactId>
      <version>${querydsl.version}</version>
      <classifier>jakarta</classifier>
    </dependency>
    <dependency>
      <groupId>com.querydsl</groupId>
      <artifactId>querydsl-apt</artifactId>
      <scope>provided</scope>
      <version>${querydsl.version}</version>
      <classifier>jakarta</classifier>
    </dependency>

Would be nice, if you could update your documentation. See e.g. http://querydsl.com/static/querydsl/latest/reference/html/ch02.html#d0e147 - IMHO you should add the classifier in RED and explain below to remove it for javax.persisntence usage. It is 2023 and spring-boot and quarkus all have moved to jakarta EE so it is the default for new projects and should be found in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment