-
Notifications
You must be signed in to change notification settings - Fork 75
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
Adds support for jakarta persistence annotations #576
Conversation
Looks good. No mutations were possible for these changes. |
Thanks for this PR! It's a very useful addition. Would you like to add unit tests for this as well? I can do it myself but it might take a little longer :). |
I wasn't sure where to add them. I saw test class that used javax.persistence.Entity. In theory all of these need to run with jakarta.persistence.Entity, too. In theory, those could be copied or adapted. I did not see any unit test that directly checks the detected annotations. But I did not invest a lot of time exploring the code. Where and how would you test these based on the existing tests? If you point me into the direction, I might add them in near future |
That's a good question, the answer is indeed not very obvious. I have no experience with Jakarta, so I'm not sure how it's structured. If there's a small dependency that contains just the annotations and not (much) more, just add it to the pom. If the only way to add it to the pom is with a dependency of 120MB pulling in all of Jakarta, maybe do what I did with |
BTW, I'm actually in the process of re-writing the project to a multi-module setup, so depending on when I merge, you might have merge conflicts. If that happens, I will make sure they get fixed. I mention it just so you won't be surprised if it happens :) |
Jakarta (or more specific JPA 3.0) is JPA 2.x with new package names. See Thorben Janssen's article. What I did:
|
Looks good. No mutations were possible for these changes. |
Yeah, I agree they should probably be merged somehow, because it's a lot of duplication. I'll put it on the backlog, for now this will do. Thanks for adding the tests so quickly! Much appreciated! |
I'll try to make a release today or tomorrow, I'll let you know when it happens. |
Released in version 3.8.3! |
What problem does this pull request solve?
Jakarta persistence's annotations were not supported.
Please provide any additional information below.
Jakarta persistence's annotations only rename "javax.persistence" to "jakarta.persistence" afaIk.
NOTE
mvn spotless:apply
to format the code before opening a PR. Otherwise, GitHub Actions will complain at you 😉. Unfortunately, you will need to have Node installed to do so.