Skip to content

Phase 2A+2B: Hibernate 6 JAR swap + javax→jakarta migration#2

Draft
megamattron wants to merge 3 commits intomodernizationfrom
phase-2ab-javax-jakarta-h6
Draft

Phase 2A+2B: Hibernate 6 JAR swap + javax→jakarta migration#2
megamattron wants to merge 3 commits intomodernizationfrom
phase-2ab-javax-jakarta-h6

Conversation

@megamattron
Copy link
Member

Summary

  • Swap Hibernate 5.6.x JARs for Hibernate 6.6.4.Final
  • Replace javax.persistence-api 2.2 with jakarta.persistence-api 3.1.0 and jakarta.transaction-api 2.0.1
  • Remove obsolete JARs: hibernate-c3p0, hibernate-ehcache, hibernate-commons-annotations, antlr-2.7.7, jboss-transaction-api
  • Rename all javax.persistence imports → jakarta.persistence across 94+ files (framework src, test-src, and all sample apps)
  • Fix PersistentMap import: org.hibernate.collection.internalorg.hibernate.collection.spi (H6 package reorganization)
  • Update dependencies.yml to reflect new artifact coordinates

Result

ant compile passes with zero errors. One deprecation warning remains (getElementType() on CollectionPersister) which is a separate concern.

ant unittest has one pre-existing failure (GroovyTemplateTest) due to Groovy 3.0.22's bundled ASM not supporting the current JDK class file version — this failure exists on modernization before these changes.

Test plan

  • ant compile — passes (zero errors)
  • ant unittest — same pass/fail ratio as modernization baseline (only GroovyTemplateTest fails, pre-existing)
  • No javax.persistence symbols remain in framework or sample app source files

- Replace hibernate-core 5.6.5 with 6.6.4.Final
- Replace javax.persistence-api 2.2 with jakarta.persistence-api 3.1.0
- Add jakarta.transaction-api 2.0.1
- Remove hibernate-c3p0, hibernate-ehcache, hibernate-commons-annotations, antlr-2.7.7, jboss-transaction-api jars
- Rename all javax.persistence imports → jakarta.persistence in framework src, test-src, and samples-and-tests (94+ files)
- Update dependencies.yml accordingly
In H6, PersistentMap moved from org.hibernate.collection.internal
to org.hibernate.collection.spi. Update the import in JPABase.java.

ant compile now passes with zero errors (one deprecation warning for
getElementType() which is a separate concern).
… Blob, DB, dialects)

- HibernateInterceptor: remove EmptyInterceptor, implement Interceptor directly;
  fix onCollection* methods from boolean to void return type (H6 API change)
- Blob: update UserType<Blob> generic interface; int getSqlType() replaces int[] sqlTypes();
  nullSafeGet now takes column position int not String[] names; drop StringType.INSTANCE
- DB: replace SessionImpl.getSession().connection() with Session.doReturningWork()
- EvolutionQuery: Oracle8iDialect -> OracleDialect
- JPAPlugin: MySQL8Dialect->MySQLDialect, Oracle10gDialect->OracleDialect,
  remove H6-removed dialects (DB2400, DB2390, SybaseAnywhere, SAPDB, Informix,
  Ingres, Progress, Mckoi, Interbase, Pointbase, Frontbase, Firebird)
- MySQLDialect: replace MySQLInnoDBDialect (removed in H6) with MySQLDialect base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant