Skip to content

DRYD-2082: Update Hibernate#524

Merged
mikejritter merged 26 commits into
collectionspace:upgrade/dryd-1633-core-updatesfrom
mikejritter:upgrade/dryd-2082-hibernate
Apr 14, 2026
Merged

DRYD-2082: Update Hibernate#524
mikejritter merged 26 commits into
collectionspace:upgrade/dryd-1633-core-updatesfrom
mikejritter:upgrade/dryd-2082-hibernate

Conversation

@mikejritter
Copy link
Copy Markdown
Contributor

What does this do?

  • Update hibernate to 5.6.15.Final to match nuxeo
  • Move annotations on created/updatedAt to fields
  • Create DateAdapter for XML serialization
  • Prefer javax.transaction connection properties
  • Remove unused connection properties

Why are we doing this? (with JIRA link)
Jira: https://collectionspace.atlassian.net/browse/DRYD-2082

This updates our hibernate dependencies to match those in Nuxeo. It's possible we might be able to actually move to 6 or 7, however the service won't startup until the rest of the upgrade is complete so that will have to be evaluated later.

A few notes on the changes made:
From the previous xml schema to entity migration I had hoped that field and property annotations could be used together to limit changes to other parts of the code. Unsurprisingly, this turned out not to be the case, so annotations have been moved from the getters (e.g. getCreatedAtItem) to the field and the data type has been updated to Date. To continue to support the XML un/marshalling, I added a simple DateAdapter which uses ISO-8601 at UTC-0. The old getters and setters were then removed and replaced with their Date counterparts.

We have moved from javax.xml.bind to jakarta.xml.bind, however the Hibernate version we include still uses the javax namespace. To deal with this, connection properties have been moved from hibernate.cfg.xml to persistence.xml, and an additional property hibernate.xml_mapping_enabled has been specified to avoid loading any classes which deal with JAXB.

I went through the dependencies in the pom for authorization-mgt/import in order to try and start to clean them up a bit. I've organized them for compile/runtime requirements, and started to exclude any superfluous transitive dependencies (e.g. the nuxeo dependencies from common). TBH I'm not sure what the classpath was like previously; this is mostly the result of debugging and seeing what classes were not being found and causing exceptions.

How should this be tested? Do these changes have associated tests?
For this, primary testing is that the create_db and import database targets complete. To do this you can follow the normal deploy steps using the application upgrade branch

  • [services] mvn clean install -DskipTests
  • [application] mvn clean install -DskipTests
  • [services] ant undeploy deploy
  • [services] ant create_db import

Dependencies for merging? Releasing to production?
Of course, the upgrade is still in progress.

There are some additional changes to look for but can likely be handled when we test the integration tests. For example, there are still some hibernate.cfg.xml files laying around, but they look to be unused.

Has the application documentation been updated for these changes?
No

Did someone actually run this code to verify it works?
@mikejritter ran the import ant target locally

@mikejritter mikejritter merged commit 9963459 into collectionspace:upgrade/dryd-1633-core-updates Apr 14, 2026
@mikejritter mikejritter deleted the upgrade/dryd-2082-hibernate branch April 14, 2026 19:48
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