I am not against Hibernate. I am against not knowing what it emits.
The failure mode is always the same
Something is slow. Someone adds a fetch join. Something else becomes slow. Six months later the mapping is a knot of hints and nobody wants to touch it, because the mapping now encodes performance decisions rather than the shape of the domain.
What we changed
- Reads that feed a screen go through explicit SQL and map to a record. The screen is the contract, not the entity.
- Writes stay with the ORM, where identity and dirty checking earn their keep.
- Every non-trivial query has its plan captured in a test that fails if it changes shape.
The codebase got longer and considerably easier to reason about. That is usually a good trade.
Tags:
1 Comments
Leave a comment
Sign in to leave a comment.
Signing in is unavailable right now.







Yara Mansour
October 2, 2024The "screen is the contract, not the entity" line is going straight into our team wiki.