feat: migrate from Hibernate JPA to Micronaut Data JDBC#3
Merged
Conversation
Replaces Hibernate/JPA with Micronaut Data JDBC to reduce JAR size (~85MB of Hibernate/ByteBuddy/JAXB removed) and startup time. Flattens the TABLE_PER_CLASS inheritance + @ElementCollection model into explicit junction tables (budget_account, security_user) with FK-column repos. Also includes: - Docker: Alpine JRE base, BuildKit cache mounts, .dockerignore, v2.0.0 - Micronaut AOT enabled for compile-time bean pre-computation - Schema managed via db/schema.sql (INIT=RUNSCRIPT); schema-generate: NONE - Telegram DefaultBotSession timeout noise suppressed in logback (expected) - @transactional on ConfigService.setConfig() to make delete+reinsert atomic - Null-safe userId guards in SecurityService and MessageService - Removed broken unused model→entity mapper direction from both mappers - ConfigInitializer uses count() instead of findAll() for existence checks - Diagnostic IllegalStateException messages when config rows are missing
- pom: exclude telegrambots' unused Jersey/Grizzly/HK2/Javassist webhook-server stack (long-polling only) — fat JAR 28MB -> 23MB, ~19MB dead weight gone - BalanceHistoryRepository + UserRepository: CrudRepository with compile-time derived queries; drop hand-written @query + Pageable plumbing - MonobankService: push day-initial-balance sort down into SQL (Optional finders) - schema.sql is the single source of truth; tests now RUNSCRIPT the same schema (schema-generate: NONE) instead of generating lossy DDL from entities - add ASC indexes for balance_history(account_id, time) and the config FKs (NOTE: ASC not DESC — a DESC index on TIMESTAMP WITH TIME ZONE hits an H2 range-scan bug that returns wrong rows) - ConfigInitializer: @transactional seeding; delete redundant TestBalanceHistoryRepository All 23 tests green.
Any branch except master now builds (after tests pass) to ghcr.io/fyfar/budgetbot:test, so a new version can be tested on the server by swapping bot.image to :test and reverted by swapping back to :latest. Adds a concurrency guard to cancel superseded builds on the same branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces Hibernate/JPA with Micronaut Data JDBC to reduce JAR size (~85MB of Hibernate/ByteBuddy/JAXB removed) and startup time. Flattens the TABLE_PER_CLASS inheritance + @ElementCollection model into explicit junction tables (budget_account, security_user) with FK-column repos.
Also includes: