Hi everyone,
Issue #2276 tracks the migration of Hibernate mapping files from HBM XML to JPA annotations. There’s already an open PR #2280 for the Role entity, which went through several rounds of review — missing test-hibernate.cfg.xml update, HBM file renamed instead of deleted, duplicate inherited fields from BaseObject, missing test-persistence.xml registration, and missing DynamicUpdate.
I studied all that feedback and opened PR #2858 to migrate the DocumentType entity, addressing those points upfront so reviewers don’t have to catch the same issues again.
What my PR does:
- Adds JPA annotations to DocumentType.java (Entity, Table, Id, Column, DynamicUpdate, GenericGenerator)
- Deletes DocumentType.hbm.xml completely
- Updates both hibernate.cfg.xml and test-hibernate.cfg.xml
- Registers entity in both persistence.xml and test-persistence.xml
- Adds a Liquibase changeset to rename lastupdated to last_updated (needed for BaseObject Column compatibility)
- Uses GenericGenerator with StringSequenceGenerator to match the existing project pattern
- Single clean commit, build passes
I chose DocumentType as a starting point because it’s a simple entity (just name + description) which makes it easy to review and establish a clean migration pattern. Happy to continue with more entities if the approach looks good.
Would appreciate any feedback! @mherman22 @Agaba_Derrick_Junior