I wouldn't even know what metric to use to quantify that. Number of tables? On the order of hundreds, probably low hundreds... definitely not thousands.
It may just be that I've been lucky in that the data models I've worked with have been things that map well to using Hibernate. I will say that I haven't worked with a lot of data models where you need more than 3 or 4 joins in any given query. I know some people write far more complex queries than that, and maybe those are the kinds of scenarios that Hibernate doesn't handle well?
The problem with Hibernate is I have to learn all of these Hibernate quirks to maybe get decent speed out of a system, when I could have just written SQL and been done
Do you hand-roll your own caching mechanism when just writing plain SQL?
Using something like jOOQ has meant I rarely need any caching, unlike Hibernate where caching almost seems required.
https://www.jooq.org/doc/3.9/manual-single-page/#arrays-maps...
Never touched it again since then (not doing much Java anyway).
More recently, we've had n+1 issues (putting a printing breakpoint in EntityType.loadByUniqueKey helped me track down where). My hack to get around that was to do a bulk Criteria query up front to pre-load the session cache with the entities that were being fetched one at a time.
There were a lot of quirks that I've had to learn over the last decade, and I'm still discovering more.
Like where you have dozens and dozens of domain objects that you want to persist, and you don't want to spend all your time writing DAO code with SQL in in that is all the same but different.
Enterprise applications are rife with those.
For speed write some hand written SQL to handle those few cases (like batch imports maybe).
Also I found a handy rule:
Only create an association between entities when the entity makes no sense without the other.
For all other cases split them up and perhaps create aggregates by hand.
The problem with Hibernate is I have to learn all of these Hibernate quirks to maybe get decent speed out of a system, when I could have just written SQL and been done. This isn't even including debugging when Hibernate decides to issue N+1s.