# Title: Migrate DocumentType from HBM XML to JPA annotations (issue not assigned to anyone so i tried to fix #2276)

**URL:** <https://talk.openelis-global.org/t/title-migrate-documenttype-from-hbm-xml-to-jpa-annotations-issue-not-assigned-to-anyone-so-i-tried-to-fix-2276/1957>\
**Category:** Ask OpenELIS\
**Created:** [February 19, 2026, 6:02am UTC](https://talk.openelis-global.org/t/title-migrate-documenttype-from-hbm-xml-to-jpa-annotations-issue-not-assigned-to-anyone-so-i-tried-to-fix-2276/1957 "2026-02-19T06:02:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ketanop321](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/ketanop321/32/1139_2.png) [@ketanop321](https://talk.openelis-global.org/u/ketanop321)\
**Post date:** [February 19, 2026, 6:02am UTC](https://talk.openelis-global.org/t/title-migrate-documenttype-from-hbm-xml-to-jpa-annotations-issue-not-assigned-to-anyone-so-i-tried-to-fix-2276/1957/1 "2026-02-19T06:02:07Z")

</div>

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
