Skip to content

Move to JPA from hbm.xml#136

Merged
ottenhoff merged 8 commits intosakaicontrib:masterfrom
ottenhoff:jpa
Oct 22, 2025
Merged

Move to JPA from hbm.xml#136
ottenhoff merged 8 commits intosakaicontrib:masterfrom
ottenhoff:jpa

Conversation

@ottenhoff
Copy link
Contributor

@ottenhoff ottenhoff commented Oct 6, 2025

Key Changes

  • Replaced the legacy Hibernate XML mappings with annotation-based JPA entities and moved date fields to Instant across the attendance domain model, adding the necessary relationship metadata and last-modified tracking.
  • Refactored AttendanceDao and its implementation to drop GenericDAO, rely on the shared SessionFactory, and use the JPA Criteria API plus merge/Instant-aware queries and updates instead of named queries.
  • Updated Spring wiring to enable @transactional on the service layer, inject the DAO directly, and introduce an AttendanceStatCalcService interface plus TransactionTemplate so the stats job can manage batch updates in explicit transactions.
  • Adjusted stat-calculation and logic classes to operate on the new entity shape (including Instant sync times), and reworked the cron job to mark batches and calculate per site within dedicated transactions.
  • Upgraded the Wicket stack to 9.21.0 and changed the tool UI to convert between Instant and Date, fix the breadcrumbs markup error, and ensure interactive links (e.g., in StudentView) bind safely without JavaScript fallbacks.
  • Added lightweight unit tests covering model defaults/validation and the new stats helper to give coverage for the refactored code paths.

@ottenhoff ottenhoff merged commit 53609ce into sakaicontrib:master Oct 22, 2025
1 check passed
iihsann pushed a commit to iihsann/attendance that referenced this pull request Dec 25, 2025
…kaicontrib#136)

- Replaced the legacy Hibernate XML mappings with annotation-based JPA entities and moved date fields to Instant across the attendance domain model, adding the necessary relationship metadata and last-modified tracking.
- Refactored AttendanceDao and its implementation to drop GenericDAO, rely on the shared SessionFactory, and use the JPA Criteria API plus merge/Instant-aware queries and updates instead of named queries.
- Updated Spring wiring to enable @transactional on the service layer, inject the DAO directly, and introduce an AttendanceStatCalcService interface plus TransactionTemplate so the stats job can manage batch updates in explicit transactions.
- Adjusted stat-calculation and logic classes to operate on the new entity shape (including Instant sync times), and reworked the cron job to mark batches and calculate per site within dedicated transactions.
- Upgraded the Wicket stack to 9.21.0 and changed the tool UI to convert between Instant and Date, fix the breadcrumbs markup error, and ensure interactive links (e.g., in StudentView) bind safely without JavaScript fallbacks.
- Added lightweight unit tests covering model defaults/validation and the new stats helper to give coverage for the refactored code paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments