Switch to Jakarta by default
In 2.0 we will switch to Jakarta in the main code base and generate Java EE JPA artifacts instead.
Even though i see this is older, it now becomes at least more relevant since
- spring 6/ spring boot 3 is using jakarta
- AFAIU hibernate 6+ also uses jakarte (but you know better for sure)
I'am not sure what the effort here is, it seems like basically renaming the imports is about everything that needs to be done - so most probably this is rather a devop effort + of course you would need to duplicate code for that (somehow, right?)
Any plans on this in general?
Jakarta is supported through the jakarta specific artefacts:
<dependency>
<groupId>com.blazebit</groupId>
<artifactId>blaze-persistence-core-api-jakarta</artifactId>
<version>${blaze-persistence.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.blazebit</groupId>
<artifactId>blaze-persistence-core-impl-jakarta</artifactId>
<version>${blaze-persistence.version}</version>
<scope>runtime</scope>
</dependency>
This is done using a bytecode replacement.
The issue is about switching over to the Jakarta API's by default and instead relying on the bytecode replacement / special artefacts for the javax API's.
Pragmatically however, it might also be possible for 2.x to drop support for the javax. API's and older Hibernate versions entirely.
Not sure how this helps, but i'am also not used doing it this way, so i might do it the wrong way here.
Adding those dependencies, which you describe will replace it in the bytecode, will not fix my issue in terms of i cannot even compile due to the missing symbols.
I'am entirely unsure how this is supposed to work, since jakarta.persistence.EntityManager will not become javax.persistence.EntityManager and vice versa right? So if spring boot exposes and EM of type jakarta.persistence.EntityManager and i feed this into BP at some point, the compiler will complain.
Could you explain how you expect this to work / how it should be used? Thanks!
We transform our artifacts into jakarta variants which only contain uses of the jakarta namespace, which you can use when you append the -jakarta suffix to the artifact ids of your blaze-persistence dependencies. There is no Spring 6 and Spring Boot 3 integration yet though.
Thank you both for helping out here. IMHO we might have a short doc which describes what -jakarta packages are available, or just, that you need to basically suffix everything beside the hibernate 6.0 integration.
This would help people to migrate until this issue/FR has been moved on (moving to jakarta by default).
If it is just me and obvious to anybody else, just ignore this comment :)